Reputation: 246
Let's say the XPath is "/bookstore/book[price=35.00]" (from the w3 example).
Here's a fiddle with how far I've got so far.
https://jsfiddle.net/npvgfzwc/
var name = src.find("bookstore book:has(price:contains('35.00')) title").text();
I can get it to select books with a price containing 35.00, but can't find a way to make it match exactly that. Is there a way to do this?
Upvotes: 0
Views: 247
Reputation: 82231
You need to use:
var name=src.find("bookstore book price").filter(function(){
return $(this).text()=="35.00"
}).prev().text();
$('#blah').text(name);
Upvotes: 1