Why does Document.prototype.getElementsByName exist in Chrome?

As I know, getElementsByNamethis is a function defined in HTMLDocument, but HTMLDocumentinherits from Documentand Documentinherits from Node.

So why am I seeing Document.prototype.getElementsByNamein Chrome, but not in Firefox? Doesn't Chrome use the DOM2 specification?

+4
source share
1 answer

Does Chrome implement the DOM2 specification?

Yes, probably not. I guess they are, at least, implement DOM 3 , if not more than the current version : -)

a getElementsByName. ? HTML5 (WHATWG/W3) Document :

DOM , [HTML5] [...]

http://dev.w3.org/html5/spec-LC/dom.html#documents-in-the-dom

HTMLDocument , , , .

, . , - DocumentPrototype - , . WebIDL .

, Chrome ( HTMLDocument?), Firefox . , window.document - : -)

+3

Source: https://habr.com/ru/post/1526870/


All Articles