Objet Paragraphe HTML DOM
Objet paragraphe
L'objet Paragraph représente un élément HTML <p>.
Accéder à un objet paragraphe
Vous pouvez accéder à un élément <p> en utilisant getElementById() :
Exemple
var x = document.getElementById("myP");
Créer un objet paragraphe
Vous pouvez créer un élément <p> en utilisant la méthode document.createElement() :
Exemple
var x = document.createElement("P");
Propriétés de l'objet Paragraphe
Property | Description |
---|---|
align | Not supported in HTML5. Use
style.textAlign instead. Sets or returns the value of the align attribute of the paragraph |
Propriétés et événements standard
L'objet Paragraph prend également en charge les propriétés et les événements standard .
Pages connexes
Tutoriel HTML : Paragraphes HTML
Référence HTML : balise HTML <p>