Reputation: 9075
I have an input element with onclick
attribute attached to it:
<input id="" type="radio" name="" value="" onclick="SetUniqueRadioButton('rptrDelRates.*grpDelRate', this);">
Everything is working good, but when I decide to trigger click manually on this element using jQuery
I get the error below:
Invalid regular expression: /rptrDelRates.*grpDelRate/: Stack overflow
jQuery call:
$('.setup-radio').on('click', function () {
$(this).find('input').trigger('click');
return false;
});
Upvotes: 3
Views: 5793
Reputation: 1
your SetUniqueRadioButton function must add event.stopPropagation();
code may case loop because of bubble
Upvotes: 0
Reputation: 82251
you can call the native doms onclick directly:
$(".setup-radio")[0].onclick();
without jquery:
document.getElementsByClassName("test_default")[0].onclick();
Upvotes: 3