JS loop web page elements, manual trigger events

xiaoxiao2021-03-06  40

JS loop web page elements, manual trigger events

for

(i

=

0

i

<

Document.all.tags

"

INPUT

"

) .length; i

) {

IF

(Document.All.tags

"

INPUT

"

[i] .type

==

"

Checkbox

"

) {

IF

(SELECTED)

&&&&

!

Document.all.tags

"

INPUT

"

[i] .checked) docuument.all.tags (

"

INPUT

"

) [i] .click ();

Else

IF

(

!

SELECTED

&&&&

Document.all.tags

"

INPUT

"

[i] .checked) docuument.all.tags (

"

INPUT

"

) [i] .click ();}}

Choose the HTML element via Document.all.Tags so that you can traverse all the elements you want to find through loop.

转载请注明原文地址:https://www.9cbs.com/read-75508.html

New Post(0)