Jquery替换已存在于element上的event的方法_jquery
来源:动视网
责编:小采
时间:2020-11-27 20:47:47
Jquery替换已存在于element上的event的方法_jquery
Jquery替换已存在于element上的event的方法_jquery:看下面code: 代码如下: TestPage $(document).ready(function() { $(#btn1).unbind('click').removeAttr('onclick').click(function() { alert('The method has invoked by Jquery.'); });
导读Jquery替换已存在于element上的event的方法_jquery:看下面code: 代码如下: TestPage $(document).ready(function() { $(#btn1).unbind('click').removeAttr('onclick').click(function() { alert('The method has invoked by Jquery.'); });

看下面code:
代码如下:
TestPage script>
$(document).ready(function() {
$("#btn1").unbind('click').removeAttr('onclick').click(function() {
alert('The method has invoked by Jquery.');
});
});
function foo()
{
alert('The method has invoked.');
}
script>