From cb9e359a51c3249d8f5157db69d43fd413ddeda6 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 14:45:12 +0100 Subject: unslug ca: move --- .../reference/global_objects/string/sub/index.html | 109 +++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 files/ca/web/javascript/reference/global_objects/string/sub/index.html (limited to 'files/ca/web/javascript/reference/global_objects/string/sub') diff --git a/files/ca/web/javascript/reference/global_objects/string/sub/index.html b/files/ca/web/javascript/reference/global_objects/string/sub/index.html new file mode 100644 index 0000000000..0b512d038e --- /dev/null +++ b/files/ca/web/javascript/reference/global_objects/string/sub/index.html @@ -0,0 +1,109 @@ +--- +title: String.prototype.sub() +slug: Web/JavaScript/Referencia/Objectes_globals/String/sub +translation_of: Web/JavaScript/Reference/Global_Objects/String/sub +--- +
{{JSRef}} {{deprecated_header}}
+ +

El mètode sub() crea un element HTML {{HTMLElement("sub")}} que fa que una cadena es mostri com a subíndex.

+ +

Sintaxi

+ +
str.sub()
+ +

Descripció

+ +

El mètode sub() incrusta una cadena a una etiqueta <sub>: "<sub>str</sub>".

+ +

Exemples

+ +

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

+ +

El codi següent utiltza els mètodes sub() i {{jsxref("String.prototype.sup()", "sup()")}} per donar format a una cadena:

+ +
var superText="superíndex";
+var subText="subíndex";
+
+console.log("Així es com es veu un " + superText.sup());
+// Així es com es veu un <sup>superíndex</sup>.
+
+console.log("Així es com es veu un " + subText.sub());
+// Així es com es veu un <sub>subíndex</sub>.
+
+ +

Especificacions

+ + + + + + + + + + + + + + +
EspecificacióEstatComentaris
{{SpecName('ES6', '#sec-string.prototype.sub', 'String.prototype.sub')}}{{Spec2('ES6')}} +

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

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
CaracterísticaAndroidChrome per AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

Vegeu també

+ + -- cgit v1.2.3-54-g00ecf