tags:

views:

55

answers:

2

Does anyone know how can I checked a radio button by using the name instead of id in jquery?

+2  A: 
$('input:checkbox[name=someName]').attr('checked', 'checked');
redsquare
Care to explain the downvote mystery person?
redsquare
A: 

generally, attribute-based selectors take the form

[name op pattern]

(including the brackets) where name is the name of the attribute, op is a relational operator, and pattern is matched against the attribute's value. see Attribute Filters in the docs

just somebody