I am passing a table row to a function which is supposed to update the onclick attribute on an anchor.
Whatever I have tried I am not able to set it to a new value. I can see that it is jQuery selects the anchor. But when I alert before an after, onclick attribute still points to the same value not the ‘url’ parameter that is provided to the function:
function modifyTrEditUrl(tr, url) {
console.log(tr.find('td:eq(6) a')[0]);
tr.find('td:eq(6) a')
.attr('onclick', url); // I have tried
//.click(function(e){..}) way too!
console.log(tr.find('td:eq(6) a')[0]); //still the same value! :(
}
Any advices?
How about using