| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/String/small | [Back] [Original] |
Get to know MDN better
Cette page a t traduite partir de l'anglais par la communaut. Vous pouvez contribuer en rejoignant la communaut francophone sur MDN Web Docs.
vitez d'utiliser cette fonctionnalit dans de nouveaux projets. HTML wrapper methods exist only for backwards compatibility. Use DOM APIs to create elements instead. Cette fonctionnalit peut tre candidate la suppression des standards web ou des navigateurs.
Envisagez d'utiliser plutt les fonctionnalits suivantes : DOM.
La mthode small() permet de crer un lment HTML <small>, ce qui permet d'afficher la chane de caractres dans une fonte de petite taille.
str.small();
Une chane de caractres reprsentant un lment HTML <small>.
La mthode small() encadre la chane courante dans une balise <small> :
"<small>str</small>"
small()L'exemple suivant illustre les diffrentes mthodes de String permettant de changer la taille d'une chane de caractres :
var worldString = "Coucou monde";
console.log(worldString.small()); // <small>Coucou monde</small>
console.log(worldString.big()); // <big>Coucou monde</big>
console.log(worldString.fontsize(7)); // <font size="7">Coucou monde</fontsize>
L'objet element.style permet d'utiliser l'attribut style de l'lment et de le manipuler de faon gnrique. Par exemple :
document.getElementById("IDlment").style.fontSize = "0.7em";
| Spcification |
|---|
| ECMAScript 2027 LanguageSpecification # sec-string.prototype.small |
Cette page a t modifie le 3 aot 2023 par les contributeurices du MDN.
StringString.prototype.anchor()String.prototype.at()String.prototype.big()String.prototype.blink()String.prototype.bold()String.prototype.charAt()String.prototype.charCodeAt()String.prototype.codePointAt()String.prototype.concat()String.prototype.endsWith()String.prototype.fixed()String.prototype.fontcolor()String.prototype.fontsize()String.prototype.includes()String.prototype.indexOf()isWellFormed()String.prototype.italics()String.prototype.lastIndexOf()String.prototype.link()String.prototype.localeCompare()String.prototype.match()String.prototype.matchAll()String.prototype.normalize()String.prototype.padEnd()String.prototype.padStart()String.prototype.repeat()String.prototype.replace()String.prototype.replaceAll()String.prototype.search()String.prototype.slice()String.prototype.small()String.prototype.split()String.prototype.startsWith()String.prototype.strike()String.prototype.sub()String.prototype.substr()String.prototype.substring()String.prototype.sup()String.prototype.toLocaleLowerCase()String.prototype.toLocaleUpperCase()String.prototype.toLowerCase()String.prototype.toString()String.prototype.toUpperCase()toWellFormed()String.prototype.trim()String.prototype.trimEnd()String.prototype.trimStart()String.prototype.valueOf()String.prototype[@@iterator]()Object/FunctionObject.prototype.__defineGetter__()Object.prototype.__defineSetter__()Object.prototype.__lookupGetter__()Object.prototype.__lookupSetter__()Object.prototype.hasOwnProperty()Object.prototype.isPrototypeOf()Object.prototype.propertyIsEnumerable()Object.prototype.toLocaleString()Object.prototype.toString()Object.prototype.valueOf()Certaines parties de ce contenu sont protges par le droit d'auteur 19982026 des contributeurs individuels de mozilla.org. Contenu disponible sous une licence Creative Commons.
| Web Proxy Viewer | New URL | Original Page |