Powered by:
Yahoo! Query Language
Created by:
Juriy "kangax" Zaytsev
HTMLFormElement
,
HTMLElement
,
Element
,
Node
,
EventTarget
,
ElementCSSInlineStyle
as well as
Object.prototype
<form> <input type="text" name="submit" value="Submit!"> <input type="text" name="style"> </form> ... <script type="text/javascript"> document.forms[0].submit; // "[object HTMLInputElement]" document.forms[0].style; // "[object HTMLInputElement]" </script>
HTMLDocument
,
Document
,
Node
,
EventTarget
as well as
Object.prototype
<form name="getElementById"> ... </form> <form name="body"> ... </form> ... <script type="text/javascript"> document.getElementById; // "[object HTMLFormElement]" document.body; // "[object HTMLFormElement]" </script>
AbstractView
,
EventTarget
<div id="addEventListener"> ... </div> ... <script type="text/javascript"> window.addEventListener; // "[object HTMLDivElement]" </script>
item
, length
, etc.
Opera is partially affected in the same way - while length
is never shadowed,
such NodeList
methods as item
and namedItem
are.
NodeList
and
Object.prototype
<div id="item"> ... </div> ... <span id="length"></span> ... <script type="text/javascript"> document.getElementsByTagName('div').item; // [object HTMLDivElement] document.getElementsByTagName('span').length; // [object HTMLSpanElement] </script>
<form name="window" onclick="console.log(window, setInterval)"> <input name="setInterval"> </form> // when clicked, logs [object HTMLFormElement], [object HTMLInputElement]
<div id="test" show="foo"> ... </div> ... <form name="evaluate" action="/"></form> ... <script type="text/javascript"> $('test').show; // "[object HTMLDivElement]" Prototype.BrowserFeatures.XPath; // true (due to truthy `document.evaluate`) </script>
Thanks to Garrett Smith for writing an Unsafe Names for HTML Form Controls article which inspired me to create this tool.