I’d like to select all the <a> elements on the page with either jQuery or straight javascript. The catch is I only way to select it if the anchor directly contains text and nothing else. Is there a way to select only text nodes?
I’d like to select all the <a> elements on the page with either jQuery
Share
Try this:
$('a:not(:has(*))')Demo: http://jsfiddle.net/QAamN/