JS中表单元素的获取

<form id="editForm" onsubmit="return false" >
    <tr>
        <td>
           <input type="radio" name="radio1"  value="1">是</input>
           <input type="radio" name="radio1"  value="0">否</input>
         </td>
   </tr>
</form>

获取选中表单元素的值:

    var sf  = "";
	for(var i=0;i<editForm.radio1.length;i++){
        if(editForm.radio1[i].checked==true){
      	  sf = editForm.sfyxxg[i].value;
        break;
        }
	}

猜你喜欢

转载自blog.csdn.net/BingoXing/article/details/81105624