tags:

views:

74

answers:

2

I'm new to jQuery. This would be no problem for me using xpath expressions, but how can i do this the 'jQuery' way?

Given following example:

<stuff>
<a href="target.html">ASDF</a>
<a href="target.html"><img src="asdf.png"/></a>
</stuff>

How can i select with jQuery only the text links and leave the links with the img tags untouched?

Help me j Query kenobi, you are my only hope ;)

Princess Lia

A: 
$('a:not(img)')

That should do the job.

Matt
Does not work. This one does $('a:not(:has(img))')
Jose Basilio
+3  A: 

$('a:not(:has(img))')

Daniel Moura
Excellent response. +1
Jose Basilio
Thx a lotMay the source be with you Daniel ;)