var js = "alert('B:' + this.id); return false;"; // creates a function from the "js" string var newclick = eval("(function(){"+js+"});"); // clears onclick then sets click $("#anchor").attr('onclick', '').…
var js = "alert('B:' + this.id); return false;"; // creates a function from the "js" string var newclick = eval("(function(){"+js+"});"); // clears onclick then sets click $("#anchor").attr('onclick', '').…