js Get Settings page elements

1. acquired by the tag name
Here Insert Picture Description
2 obtained by the id
Here Insert Picture Description
3. acquired by the class name
Here Insert Picture Description
4. acquired by the name attribute
Here Insert Picture Description
Note: Only the id is not unique suffix should be possible to obtain only one of the other three is not a
if the suffix is the time to get all the elements in that name by using the variable should be added [3] and the corresponding suffix in brackets after the variable numbers.
set html tag text
innerHtml will modify the start and end tags Everything between the tags, covering subelements
innerText text changes only
Here Insert Picture Description
by modifying js html style
Here Insert Picture Description
for loop to set the content of a set of labels li
Here Insert Picture Description

Published 36 original articles · won praise 3 · Views 2999

Guess you like

Origin blog.csdn.net/weixin_46146313/article/details/104109878