JS输入框的只读与可写

<html >
<head>

</head>
<body>
 <input id="bbc" value="写我试试">
<input type="button" value="只读" id="bbd" onclick="bbs()">
<script>
function bbs()
{
bbc.readOnly=!bbc.readOnly;
if(bbd.value=="只读")
bbd.value="可写"
else
bbd.value="只读"
}
</script>

</body>
</html>

你可能感兴趣的:(JS输入框的只读与可写)