troubleshooting Question

Change Show/ Hide label on toggle

Avatar of nikhilbansal
nikhilbansal asked on
8 Comments1 Solution392 ViewsLast Modified:
Hi All,

I need this urgently.

I have a Hide option into a <td>

      <p><font size="5"><strong></strong></font>&nbsp;</p>
      <p><font size="5"><strong>Contents</strong></font> <a onclick="toggle('q1')"

and I am using the javascript code

function toggle(obj) {

var obj=document.getElementById(obj);

      if ( == "block") {
   = "none";
      else {
   = "block";

to show/ hide the contents. This so far is working fine

But now I need to change the label "Hide" to "show" when the contents are hidden and "Show" to "Hide" when the cotents are shown.

Please let me know what to do.



Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros