Deprecated
This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
El mètode big()
crea un element HTML <big>
que causa que la cadena es mostri en una font de mida gran.
Sintaxi
str.big()
Descripció
El mètode big()
incrusta una cadena dins del tag <big>
: "<big>str</big>"
.
Exemples
Utilitzar big()
L'exemple següent utilitza mètodes string per canviar la mida d'una cadena:
var worldString = 'Hello, world';
console.log(worldString.small()); // <small>Hello, world</small>
console.log(worldString.big()); // <big>Hello, world</big>
console.log(worldString.fontsize(7)); // <fontsize=7>Hello, world</fontsize>
Amb l'objecte element.style
es pot obtenir l'atribut style
de l'element i manipular-lo més genèricament, per exemple:
document.getElementById('yourElemId').style.fontSize = '2em';
Especificacions
Especificació | Estat | Comentaris |
---|---|---|
ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'String.prototype.big' in that specification. |
Standard | Definició inicial. Implementat en JavaScript 1.0. Definit en l'Annex B (normative) per característiques addicionals 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) |