문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top