Skip to content Skip to sidebar Skip to footer

Jquery Not Triggering On Radio Button Change

Sorry for bothering, but I'm new to jquery and trying to figure this out. Thanks in advanced. I have a web page filled with several sets of radio buttons based on several computer

Solution 1:

You can trigger the change event using .trigger():

...
$('input:radio[name=psu]')[1].checked = true;
$('input:radio[name=hdd]')[2].checked = true;

$('input:radio').trigger('change');

Also, don't use input:radio. input:radio isn't a CSS selector and won't be supported by document.querySelector, so it will run slower than input[type="radio"].

I suggest you re-think your layout. You should't have to repeat the same block of code every time with just minor changes.

Post a Comment for "Jquery Not Triggering On Radio Button Change"