Javascript

Joined
Sep 26, 2010
Messages
39
Reaction score
0
Points
6
Hi, I know nothing about Javascript and I'm trying to embed some into my website. I want to have a h2 tag that toggles appearing/disappearing (by default it is not hidden) on click of a p tag and then while the h2 tag is disappearing another p tag will appear (and toggle). I found this on a forum:

<script type="text/javascript">
$(document).ready(function(){
$(".msg_body").hide();
$(".msg_head").click(function()
{
$(this).next(".msg_body").slideToggle();
});});
</script>

But this only toggles one thing. Can anyone help me?
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top