Pregunta

I am currently teaching myself the HTML DOM, and I have learned that (in order to create an HTML element) I must use document.create & document.createTextNode. My question is whether all HTML elements require a text node? Do image tags, form fields, or other HTML elements which don't display text have a textnode value?

¿Fue útil?

Solución

No. Text nodes are only required if you want text (other then that supplied through a property such as HTMLInputElement.value) in an element.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top