javascript - select only inside div with js
How do I select the 1st a in this code with javascript? (href=some.php)
<div class="accordionButton"><div id="acr_btn_title"><a
href="some.php"><p>stuff</p></a></div><div
class="hn_little_box"></div></div> <div class="accordionContent" > <ul>
<li><a href="page_01">Page 01</a></li> <li><a href="page_02">Page
02</a></li> <li><a href="page_03">Page 03</a></li> </ul> </div>
I want to make it so when that <a> is clicked, the javascript doesn't
execute. This is for an accordion side nav, so when it's clicked the
accordion doesn't expand, but still tells the browser to go to that page.
I'm thinking something like this:
<script type="text/javascript"> $('#acr_btn_title a').click(function() {
return false; }); </script>
No comments:
Post a Comment