我通常不會使用onclick,但是當我遇到這個問題時,我會爲完全不同的目的做一些調試編碼。我完全失明瞭,或者爲什麼這不工作?html js - onclick不能正常工作
<html>
<head>
<script type="text/javascript">
function click()
{
alert("hey");
}
</script>
</head>
<body>
<!-- Will not work in any browser -->
<input type="button" onclick="click()" value="click me" />
<!-- Will not work in IE -->
<a href="#" onclick="click()">click me</a>
<!-- Works in all -->
<input type="button" onclick="alert('hey')" value="click me" />
<a href="#" onclick="alert('hey')">click me</a>
</body>
</html>
謝謝,世界再次合理。 – quano 2011-04-07 15:02:22