这段代码不起作用?当我尝试单击单选按钮时,没有任何反应。假设它将被禁用,但没有任何内容被禁用和启用。这是代码。
<script type="text/javascript">
function ann()
{
document.getElementById('butta').disabled = true;
document.getElementById('strup').disabled = true;
document.getElementById('name').disabled = false;
}
function own()
{
document.getElementById('butta').disabled = false;
document.getElementById('strup').disabled = false;
document.getElementById('name').disabled = true;
}
</script>
<input type="radio" name="checktype" id="ann" onclick="ann()" value="1"> Anime<br>
<input type="radio" name="checktype" id="own" onclick="own()" value="2"> My picture<br>
最佳答案
您的单选按钮 ID 错误。
关于javascript - OnClick 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1223219/