非常簡單的代碼,由於某種原因我沒有嘗試將工作!我顯然已經導入了Jquery,jqueryUI,ajax,我需要導入的所有東西(不止一次!)。但由於某種原因,這個按鈕不想用Jquery點擊!我知道它與onClick合作,但我想爲此使用jquery。 SOS!Jquery無法正常工作按鈕點擊
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<script src="jquery-1.11.3.min.js"></script>
<script>
$("#heyo").click(function(){
alert();
});
$("input").click(function(e){
var id1 = e.target.id;
alert(id1);
});
$('input[type="button"]').click(function(){
alert();
});
function pie(){
//alert();
}
</script>
<body>
loading...
<input type="button" id="heyo" onclick="pie()" value="ff" />
</body>
的[可能的複製爲什麼jQuery的或DOM方法等的getElementById不找到元素?](http://stackoverflow.com/questions/14028959/why-does-jquery-or-a-dom-method-such-as-getelementbyid-not-find-the-element) –