您的位置:首页 > 其它

使用Script控制readOnly属性

2008-12-30 16:56 169 查看
<html>
<script>
function ee()
{
document.getElementById("MyID").readOnly=false;//-->正确
// document.myform.ff.readonly=false; ---->错误
}
</script>
<body>
<form name="myform">
<input id="MyID" type="text" name="mytext" value="" readonly>
<input type="button" value="mybutton" onclick="ee()">
</form>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  button input