87,993
社区成员
发帖
与我相关
我的任务
分享
<input type="text" name="name" disabled>
<button type="button" >变更状态</button>
<script>
function changerstate()
{
if ($("#test").prop("disabled")) {
$("#test").removeAttr("disabled");
}
else {
$("#test").attr("disabled", true);
}
}
</script>
</head>
<body>
<input id="test" type="text" name="name" disabled/>
<button type="button" onclick="changerstate()">变更状态</button>
</body>
要不你把你的代码贴出来看看
[/quote]
我在去检查下代码吧,多谢啦! <script>
function changerstate()
{
if ($("#test").prop("disabled")) {
$("#test").removeAttr("disabled");
}
else {
$("#test").attr("disabled", true);
}
}
</script>
</head>
<body>
<input id="test" type="text" name="name" disabled/>
<button type="button" onclick="changerstate()">变更状态</button>
</body>
要不你把你的代码贴出来看看
<script>
function changerstate()
{
if ($("#test").prop("disabled")) {
$("#test").removeAttr("disabled");
}
else {
$("#test").attr("disabled", true);
}
}
</script>
</head>
<body>
<input id="test" type="text" name="name" disabled />
<button type="button" onclick="changerstate()">变更状态</button>
</body>