Is Element.tagName always uppercase?

前端 未结 5 1952
醉酒成梦
醉酒成梦 2020-12-29 19:13

Reading at MDN about Element.tagName it states:

On HTML elements in DOM trees flagged as HTML documents, tagName returns the element name in the upper

5条回答
  •  轮回少年
    2020-12-29 19:18

    tagName and nodeName comes in lowercase or case sensitive, in case page response headers is having Content-type: application/xhtml+xml; header or any xhtml related content type. e.g. document.documentElement.nodeName returns html Read this for more cases: https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-745549614

提交回复
热议问题