Reputation: 12695
on my page I have many label
tags. Some of them has the for
attribute. How should be the jQuery's selector of that label's ?
Upvotes: 0
Views: 51
Reputation: 30453
Try this: $('label[for]')
if you don't know what is equal to for
Upvotes: 3
Reputation: 68790
A selector like this one will be helpful :
$('label[for="foo"]').css('color', 'red);
EDIT after comment :
To select all labels without knowing the for
value :
$('label[for]').css('color', 'red);
Upvotes: 1