我無法得到這個簡單的腳本運行,並一直盯着它一段時間,並沒有看到任何語法錯誤。只需要警報在點擊時顯示。jQuery按鈕點擊不會運行
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type='text/javascript'>
$(document).ready(function() {
$("#authenticate_button").click(function() {
alert("click");
});
});
</script>
</head>
<body>
<input id="code" type="text">
<button id='authenticate_button'>Authenticate</button>
</body>
</html>
你打開http中的文件://?如果你打開它在文件中://它不能工作。 –
瀏覽器中的控制檯說什麼? – orolo
這不是在本地文件中運行嗎? –