10个input标签,除某一个外,其余的去除只读属性:
Html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>个人信息</title>
<script src="../../js/jquery-1.12.3.min.js"></script>
<script src="../../js/personalCenter/personalInformation.js"></script>
<style type="text/css">
input{border-width: 0;}
</style>
</head>
<body>
<div>
<table>
<tr>
<td><p><span>会员等级:</span><p></td>
<td>
<input type="radio" checked="checked" disabled="disabled">
<input type="text" id="membershipLevelName" >
<input type="hidden" id="userId">
</td>
</tr>
<tr>
<td><p><span>姓名:</span><p></td>
<td><input type="text" id="userName"></td>
</tr>
<tr>
<td><p><span>电话:</span><p></td>
<td><input type="text" id="phoneNum"></td>
</tr>
<tr>
<td><p><span>性别:</span><p></td>
<td><input type="radio" name="userSex" value="男" disabled="disabled">男
<input type="radio" name="userSex" value="女" disabled="disabled">女
</td>
</tr>
<tr>
<td><p><span>邮箱:</span><p></td>
<td><input type="text" id="userEmail"></td>
</tr>
<tr>
<td><p><span>联系地址:</span><p></td>
<td><input type="text" id="userAddress"></td>
</tr>
</table>
<input type="button" value="编辑个人信息" id="edit"/>
<input type="button" value="保存" id="preserve"/>
</div>
</body>
</html>
$('input').prop("readonly",true);//将所有的input标签,表示成只读。
$("input:not(#membershipLevelName)").prop("readonly",false);//除等级名称外,去除input元素的readonly属性
$("input:not(#membershipLevelName)").css("border-width","1");//显示文本框边框
$("input:radio").removeAttr("disabled");//单选按钮可选。