Jump to content

Selector help


Samuz

Recommended Posts

Let's say I have markup along the lines of..

 

<ul>
<li>
<a href="">bla bla</a>
<ul>
<li><a href="">more bla bla></li>
<li><a href="">more bla bla></li>
</ul>
</li>
</ul>

 

And then I do something along the lines of..

 

$('ul li a').click(function() {
// stuff
});

 

How do I select only the primary link (<a href="">bla bla</a>) and ignore the nested links within (<a href="">more bla bla>)

Link to comment
https://forums.phpfreaks.com/topic/265026-selector-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.