不知道爲什麼open按鈕的onclick函數沒有被調用。 任何幫助將是非常有用的Javascript函數沒有在按鈕的onclick事件中被調用
<html>
<head>
</head>
<body>
<script>
function open(){
alert('gsfhdgf');
document.getElementById("overlay").style.display="block";
document.getElementById("fade").style.display="block";
}
</script>
<div id="fade" style="display:none">
<div id="overlay" style="display:none">
this is my content
</div>
</div>
<button onclick="open()">Click Me!</button>
</body>
</html>
@ 1nflktd會發生什麼變化? –
@NiettheDarkAbsol http://stackoverflow.com/questions/436411/where-is-the-best-place-to-put-script-tags-in-html-markup我不是說它的問題在這裏,我只是說它的*好*的做法,把它放在那裏,但把它放在任何地方,如果你想 –