JQuery表单常用操作

<form id="editForm" onsubmit="return false" >
    <tr>
        <input type="button">查询</input>
        <input type="button">重置</input>
    </tr>
    <tr>
        <td>
           <input type="radio" name="radio1"  value="1">是</input>
           <input type="radio" name="radio1"  value="0">否</input>
         </td>
   </tr>
   <tr>
      <select><option></option></select>
   </tr>
</form>

清除表单中除了button外的选项的值:

function clears(){
	var eles = jq("#editForm :input :gt(1)");
	for(var i = 0; i < eles.length; i++){
		ele = eles[i];
		ele.value = "";
	}
}

猜你喜欢

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