Google Groups Home Help | Sign in
Message from discussion show/hide javascript
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
dylanb  
View profile
 More options May 9, 3:48 pm
Newsgroups: comp.lang.javascript
From: dylanb <dylanbu...@gmail.com>
Date: Fri, 9 May 2008 12:48:48 -0700 (PDT)
Local: Fri, May 9 2008 3:48 pm
Subject: show/hide javascript
Hi can anyone tell me how to alter this script so it will works on
classes and id's;
<script>
function showhide(id){
if (document.getElementById){
obj = document.getElementById(id);
if (obj.style.display == "none"){
obj.style.display = "";
} else {

obj.style.display = "none";
}
}
}

</script>

its called by;

<a href="javascript:void(0)" onmouseover="showhide('divname')">
link</a>

<div style="display: none;" id="divname">
some content
</div>

I just need to make it work on div classes


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google