JS获取所有name为option的input的值
var objs=document.getElementsByName ("option") ; var arr=[] ; for (var i=0;i<objs.length;i++) { arr.push(objs[i].value) ; } console.log(arr);
JS动态修改div的display值为none或者block
if(vs != 3){ document.getElementById("tiankong").style.display = "block"; document.getElementById("panduan").style.display = "none"; }else{ document.getElementById("panduan").style.display = "block"; document.getElementById("tiankong").style.display = "none"; }