But I want to get a second div of li, which does not affect the first div li
- The first divli
- The first divli
- Second divli
- Second divli
How to use the document. The getElementsByTagName () method to obtain the second div of li and change the second div li without affecting the content of the first div of li's content,
CodePudding user response:
To solve?An id can be set to ul
Var ABC=document. GetElementById (" demo ");
Var lis=ABC. GetElementsByTagName (" li ");