可能是一个非常简单的错误,因为我对 JavaScript 很陌生:
<head>
<title>
Test
</title>
<script type="text/javascript">
window.onload = function() {
if document.getElementById('one').checked = function() {
document.getElementsById("TestDiv").innerHTML = "one";}
}
</script>
</head>
<body>
<input type="radio" name="one" id="one" value="one" />
<div id="TestDiv">Test</div>
</body>
提前致谢!:D