Javascript examples for jQuery:Tag Traversing
Understanding DOM hierarchy in jQuery
<html> <head> <script src="https://code.jquery.com/jquery-1.7.2.min.js"></script> </head> <body> <div id="accordionWrapper"> <p> <a class="expandall" href="#">Test</a> </p> </div> <script> jQuery('#accordionWrapper p a.expandall').click(function() { console.log('It works!'); });/*w ww. j a va 2 s .c om*/ </script> </body> </html>