首页javascriptclickjQuery Event - 如何处理来自jQuery处理程序和Javascript属性的点击事件

jQuery Event - 如何处理来自jQuery处理程序和Javascript属性的点击事件

我们想知道如何处理来自jQuery处理程序和Javascript属性的点击事件。

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.6.js'></script>
<script type='text/javascript'>
function specialFunction()
{
        console.log('Bobs your mothers brother');
}
$(window).load(function(){

    $('#special').click(function () {
        specialFunction();
        return false;
    });

});
</script>
</head>
<body>
  <div class="someclass">
    <input id="special" type="submit" value="Post"
      onclick=specialFunction() />
  </div>
</body>
</html>