TruMan1
TruMan1

Reputation: 36178

How to select this via jQuery (include text in selector)?

What is a safe and reliable way to select the link below? I am having trouble to ensure I include the "Select" text in the selector to ensure I do not select another link:

<span class="pickerWrapper">....<a href="...">Select</a></span>

Upvotes: 1

Views: 136

Answers (3)

Sam
Sam

Reputation: 4487

$('.class a:contains("Select"):last')

http://jsfiddle.net/WwSNb/

Upvotes: 0

sushil bharwani
sushil bharwani

Reputation: 30217

jQuery(".pickerWrapper a:last") should work

Upvotes: 0

Karmic Coder
Karmic Coder

Reputation: 17989

You will need to use the contains selector.

$(".pickerWrapper a:contains('Select')");

Upvotes: 4

Related Questions