Created
September 21, 2017 23:46
-
-
Save dervn/a45e73c963352ae4d5f153db4b64e0b4 to your computer and use it in GitHub Desktop.
JS 选中页面中所有复选框
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ss = document.getElementsByTagName('select'); | |
for (var i = 0; i < ss.length; i++) { | |
var se = ss[i]; | |
for (var j = 0; j < se.options.length; j++) { | |
if(se.options[j].text=='只读'){ | |
se.options[j].selected = true; | |
} | |
} | |
} | |
// 选中页面中所有复选框 | |
ss = document.getElementsByTagName('input'); | |
for (var i = 0; i < ss.length; i++) { | |
var se = ss[i]; | |
se.checked = false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment