javascript - Is it possible to change a .click() function in JQuery? -


if have .click() function in header of page, possible overwrite later in page?

for example if have in header:

<script> $("document").ready(function() {     $("a.lol").click(function () {          alert("aaa");     }); }); </script> 

would possible change $("a.lol") alert else, , not alert "aaa"?

try this,

$("document").ready(function() {     $("a.lol").click(function () { // click event         alert("aaa");     });     $("a.lol").off('click');// off click event     $("a.lol").on('click',function () { // again bind new click event on()         alert("new click");     }); }); 

read on() , off()


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

java.util.scanner - How to read and add only numbers to array from a text file -

iphone - Three second countdown in cocos2d -