I have some HTML that looks like this:
I want to use jQuery to display or hide the 'p' tag when the anchor is clicked
Since you mentioned that you'd like to toggle the 'p' tag when the anchor is clicked, I'd do:
$("a.question").click(function (event) {
$(this).siblings('p').show(); //toggle the p tags that are siblings to the clicked element
event.preventDefault(); //stop the browser from following the link
});
$(this).next("p").css("...")
the "p" above is optional, if you just want the next non-whitespace node in the DOM.
Try using:
$(this).siblings('p').css()