examples of empty element in html
Answers
Answered by
1
Empty tags in HTML are DOM Element Nodes that never have end tags, and more importantly, they can only have “attribute”, they can never have :
*.Element childnodes (embedded tags)*.CDATA childnodes (rawtext)
*.comment childnodesSo innerText and innerHTML DOM APIsproperties of such Elements will always be null.In XHTML notation, such tag must use the autoclose syntax, ending tag are still forbidden and may lead to unexpected results from user agents, IDEs, or other tools.ex:<!— HTML syntax —><hr><!-- XHTML syntax --><hr/><!-- forbidden syntax --><hr></hr>
*.Element childnodes (embedded tags)*.CDATA childnodes (rawtext)
*.comment childnodesSo innerText and innerHTML DOM APIsproperties of such Elements will always be null.In XHTML notation, such tag must use the autoclose syntax, ending tag are still forbidden and may lead to unexpected results from user agents, IDEs, or other tools.ex:<!— HTML syntax —><hr><!-- XHTML syntax --><hr/><!-- forbidden syntax --><hr></hr>
Answered by
1
Answer:
Empty Elements only has a single tag that performs a general operation. They do not work on blocks of texts.
Examples of Empty Tags are <br>,  , etc.
Similar questions
Social Sciences,
7 months ago
Geography,
7 months ago
Chemistry,
7 months ago
English,
1 year ago
Biology,
1 year ago