Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

String.prototype.sup()

This article needs an editorial review. How you can help.

Deprecated
This feature has been removed from the Web standards. Though some browsers may still support it, it is in the process of being dropped. Do not use it in old or new projects. Pages or Web apps using it may break at any time.

El mètode sup() crea un element HTML <sup> que causa que la cadena es mostri com un superíndex.

Sintaxi

str.sup()

Descripció

El mètode sup() incrusta una cadena en l'etiqueta <sup>:"<sup>str</sup>".

Exemples

Utilitzar els mètodes sub() i sup()

L'exemple següent utilitza els mètodes sub() i sup() per formatejar la cadena:

var superText = 'superíndex';
var subText = 'subíndex';

console.log('This is what a ' + superText.sup());
// "Així es com es veu un <sup>superíndex</sup>."

console.log('This is what a ' + subText.sub());
// "Així es com es veu un <sub>subíndex</sub>."

Especificacions

Especificació Estat Comentaris
ECMAScript 2015 (6th Edition, ECMA-262)
The definition of 'String.prototype.sup' in that specification.
Standard Definició inicial. Implementat en JavaScript 1.0. Definit en l'Annex B (normative) per a Característiques Addicicionals d'ECMAScript per Navegadors Web.

Compatibilitat amb navegadors

Característica Chrome Firefox (Gecko) Internet Explorer Opera Safari
Suport bàsic (Yes) 1.0 (1.7 or earlier) (Yes) (Yes) (Yes)
Característica Android Chrome per Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Suport bàsic (Yes) (Yes) 1.0 (1.0) (Yes) (Yes) (Yes)

Vegeu també

Document Tags and Contributors

 Contributors to this page: llue
 Last updated by: llue,