Sarfraz
Sarfraz

Reputation: 382696

JQuery: How to find a tag having some value

In jquery, it is easy to find input elements having a value like:

$('input[value="some value"]');

but how do you find a div with certain value:

<div>Hello There</div>

I tried this but it does not work:

$('div[value="Hello There"]');

Upvotes: 0

Views: 159

Answers (1)

g.d.d.c
g.d.d.c

Reputation: 47988

Use $('div:contains()').

Upvotes: 2

Related Questions