Find element by text in jquery
In this topic, we will see how
to find
element by text in jquery. Many times we might want to find elements by text. This is really
very simple to do in jquery.
Find element by text:-
Jquery allows us to find for a
particular element by requesting elements containing specific text. We
can’t achieve the same task easily using JavaScript in multiple browsers, so we
will use jquery to perform this simple task and it saves us a lot of time.
Find element by text example:-
Output:-
Ajay parvin - pass
Rakash - Fail
Arvind - Fail
Udhaya Kumar - Pass
$(‘p:contains(“Fail”)’).css(‘background-color’,’lightgreen’);
Share this article with your friends
Post A Comment:
0 comments: