Im trying to create a function that will toggle a paragraphs display CSS when a button is clicked only i cant seem to get it to work at all, My browser just goes back to the top of the page? My jQuery is…
$('.useful-links ul li a').click(function(){
$('.useful-links ul li a').parent('li').find('p').toggle();
});
and my markup is
<li>
<a href="#">RESIDENTIAL AGENTS</a>
<p style="display:none;">sfsdfsdfsd</p>
</li>
I’m assuming your HTML structure is like this:
Demo:
http://jsfiddle.net/p4SJB/