Identifying radio buttons

On document ready, to find the value of the check radio button, use the id together with  ‘checked’. E.g.:

$('#myradiobutton:checked').val();/>

However, to trigger a click function on the radio button, id wasn’t recognised, but the input name was. E.g.:

$('input[name=myradiobutton]').click(function{});

Perhaps it’s better to use the input name, rather than the id.

Scroll to Top