jQuery: Select readonly element

Using jQuery, how can I find an element that has the readonly attribute set?

This does NOT work:
$('input:readonly').css('background','red');

Open in new window

LVL 16
hankknightAsked:
Who is Participating?
 
leakim971PluritechnicianCommented:
else :
$('input[readonly=readonly]').css('background','red');

Open in new window

0
 
leakim971PluritechnicianCommented:
check this : http://jsfiddle.net/q36s7/2/
$('input[readonly]').css('background','red');

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.