Reputation: 89053
I'm trying to use XPath selectors with JQuery, but when I drop down to firebug (for example, in the linked page), I get syntax errors for the simplest XPath expressions:
>>> jQuery('//div')
"Syntax error, unrecognized expression: //div"
Am I doing something wrong, or are xpath selectors no longer supported?
Upvotes: 2
Views: 814
Reputation: 36767
xpath support was dropped in jquery 1.2. You can use xpath plugin if you really need it.
Upvotes: 2
Reputation: 834
XPath is not supported anymore. xpath functions not supported in jquery also talks about this.
To get all divs, use this:
>>> $('div')
or
>>> jQuery('div')
depending on your setup.
Upvotes: 1