使用以下的函数轻松搞定:
//get radio value
function radio(){
var radio = document.getElementsByName("tag_status");
var radioLength = radio.length;
var radioValue;
for(var i = 0;i < radioLength;i++){
if(radio[i].checked){
radioValue = radio[i].value;
}
}
return radioValue;
}
//get check val
function checkbox(inid){
var checkid=".checkbox"+inid+" input";
if($(checkid).is(":checked")){
return 1;
}else{
return 0;
}
}
so,done.