A brief analysis of some important attributes of the document object in JS

  • 2020-03-30 02:14:49
  • OfStack

Each element and its attributes can be accessed through these attributes, and each tag can be accessed through its corresponding array

The forms array object is a collection of all the form tags in the code page

Two: the anchors array object: specifies all the names or id attributes on a web page. A> Collection of tags, but not those that specify href tags

Three: links array object   All < that specify the href attribute; A> Collection of tags

Images array object: specifies all the < in the document; Img> Collection of tags

Scripts array object: represents all the < Script> Collection of tags

Applets: represent all the < Applets> Collection of tags

Seven: all array object: represents all tags in all documents

StyleSheets array object: a collection of all the styleSheets introduced in the document

Body object: represents a document nested within the < Body> The HTML child elements inside the tag can be referenced as attributes of the body object

Title object: represents in the document < Title> Tag pairs, used to set and reference the content on the TAB bar of a web page

Examples of their citations:
Document. All. Imag1. SRC
Document. The images. Imag1. SRC
Document. The images. The item (" imag1 "). The SRC
Document. The images. The item (0). The SRC

Access other elements can also use the same method, of course, must be the object to access the specified name or ID attribute, just remember that the array of objects can to access them through their name of the child elements, so as long as remember more than ten elements represent the meaning of can easily access and set the each element of a web document...


Related articles: