Do someone know what is the best way to replace some string inside a onclick attribute ? I need to get the current value and replace some text inside pa
You can do this: http://jsfiddle.net/SJP7k/
var atr = $('a').attr('onclick'); var str = atr.split('1'); var natr = str.join('2'); $('a').attr('onclick',natr);