我想打印的属性isChecked
:
<!DOCTYPE html>
<html>
<head>
<script>
function myFunction(){
alert(document.getElementById('myId').isChecked);
}
</script>
</head>
<body>
<img id="myId" isChecked="0"/>
<br>
<button onclick="myFunction();">Click me</button>
</body>
</html>
它打印我undefined
任何帮助表示赞赏!