jQuery Event - 如何把點(diǎn)擊事件處理程序一個(gè)函數(shù)
我們想知道如何把點(diǎn)擊事件處理程序一個(gè)函數(shù)。
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.8.3.js'></script>
<script type='text/javascript'>
$(window).load(function(){
$(document).ready(function () {
function count_send_at(event) {
console.log('bye');
}
$('#count_send_at_btn').click(count_send_at);
});
});
</script>
</head>
<body>
<a href="#" id="count_send_at_btn">HELLO</a>
</body>
</html>
The code above is rendered as follows: