日期:2014-05-17 浏览次数:20521 次
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <input type="button" id="b" value="确定"><br><br> <a href="javascript:;" onclick="change_click();return false;">点击修改button的click事件</a> <script src="js/jquery.js" type="text/javascript"></script> <script type="text/javascript"> $(function(){ $("#b").bind('click',click1); }); function change_click() { $("#b").unbind('click'); $("#b").bind("click", click2); } function click1() { alert(1); } function click2() { alert(2); } </script>