我是一個初學者,我即將完成我的第一個網站。作爲jQuery中的事件處理程序,不能調用按鈕
但我只是不能得到最後一個按鈕的工作。它是最簡單的任務,但這只是不工作。
$(document).ready(function() {
alert("mailto script loaded!");
})
//eventhandler send-button
$('#send').onclick(function() {
alert("Handler has beend called.");
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="buttonsend">
<button class="button button-pill button-flat-action" id="send">Senden</button>
</div>
你們可以給我一個提示問題出在哪裏? 非常感謝您提前。我搜索了一切,但基本上沒有辦法基於我需要做的事情。我只是不知道我要去哪裏。
將處理程序代碼添加到文檔就緒。把'onclick'改成'click' –