html - What Gets Added to `document`? -


i working on page , noticed had element bound document (ex. document.formnameid). thinking must javascript , not being able find place set, removed javascript on page. still found element name set on document.

after playing it, seems form elements have name attribute set added document. there other elements default bound that?

edit:

upon further inspection, can find elements inside form element same api.

so if input element: document.formname.inputname

check example out.

yes, these called (in html5) named properties

the description in spec says:

the document interface supports named properties. supported property names @ moment consist of values of name content attributes of applet, exposed embed, form, iframe, img, , exposed object elements in document have non-empty name content attributes, , values of id content attributes of applet , exposed object elements in document have non-empty id content attributes, , values of id content attributes of img elements in document have both non-empty name content attributes , non-empty id content attributes. supported property names must in tree order, ignoring later duplicates, values id attributes coming before values name attributes when same element contributes both.

so these happens number of elements. there description @ above link of how values of such properties determined, including how forms, becomes list of controls on form.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -