Identifying radio buttons - thehazels Identifying radio buttons - thehazelsthehazels

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.

About Antonia Whitaker

An administrative, sales and marketing background has given me an understanding of what users want from their website. I do not confuse issues with technical jargon and I listen to what people want.

01. May 2014 by Antonia Whitaker
Categories: Code | Tags: | Leave a comment

Leave a Reply

Required fields are marked *