Question

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?

Était-ce utile?

La solution

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top