Hello! There is such a link:
<a href="#" onclick="javascript:add('value1', 'opt1', 'value2', 'opt2', 'value3', 'value4'); return:false;">+</a>
It is necessary to change only opt1 and opt2 for the event, all other values are constant. Such links can be any number. Initially, the link is generated in php with predefined parameters and looks like this:
<a href="#" onclick="javascript:add('555', '25', 'http://url', '280', 'text', 'name'); return:false;">+</a>
I tried this:
$('.target').change(function() { $(this).next('a').attr("onclick", "javascript:add('" +opt1+ "', '25', 'http://url', '"+ opt2 + "', 'text', 'name'); return:false;") });
But this code will work for only one link. others have distinct permanent attributes. I suppose that you first need to get attr ("onclick") and break the parameters into constants and those that will change.