jquery attribute equals selector example
jquery
attribute equals selector:-
jquery
attribute equals selector allows us to selects the element
whose specified attribute value exactly equals a specific string value.
[attribute=value]
jquery attribute equals selector example:-
In the following example, we will see how we will select all <input> type with the value of “colorMe” and change the background color of selected <input> to “light green” using the jquery attribute equals selector.
jquery attribute equals selector example explanation :-
$(“input[value='colorMe']“).css(‘background-color’,’lightgreen’); This line tells jquery to select all <input> type elements that has the value of “colorMe”. Once the selection process is done, this css(‘background-color’,’lightgreen’); function sets the background color to lightgreen to all selected items.
Share this article with your friends
Post A Comment:
0 comments: