Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6952477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:21:15+00:00 2026-05-27T14:21:15+00:00

I have found a function on Ozzu.com that fits my needs only problem is

  • 0

I have found a function on Ozzu.com that fits my needs only problem is I do not grab whats happening 100%. Could you give me a run down of whats happening here:

function toggle(id) {
  var e = document.getElementById(id);

  if (e.style.display == '')
    e.style.display = 'none';
  else
    e.style.display = '';
}

and then this goes in the source page:

<a href="#" onclick="toggle('content')">Toggle</a>

I am confused on what the if/else is actually doing to make this work

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:21:16+00:00Added an answer on May 27, 2026 at 2:21 pm

    You’re modifying the CSS display property of the HTML element with ID “content”, onclick, via JavaScript. Every time you call the toggle function, it does essentially the following:

    if (document.getElementById("content").style.display == '') {
      document.getElementById("content").style.display = 'none';
    } else {
      document.getElementById("content").style.display = '';
    }
    

    If you set the display property to 'none', the HTML element with ID “content” will not be rendered. If you set it to empty string (""), it will use the default value for that HTML element (which is visible in all cases).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have done various tests and I have found that the jQuery validate function
Given that you have found a process that you wish to execute a function
After profiling a large game playing program, I have found that the library function
please take a quick look at this function that I have found on the
I have found the function dhist() in the ggplot2 package that implements the variable
I just have found out that there is a function called func_get_arg in PHP
I want to pass jquery command into eval() function but I have found that
I have found a javascript function that inverts colors on webpage: String javascript =
I'm using SQL Server 2008. I have found the LEN function does not return
I'm learning JQuery and have found the factory function $() with its selectors quite

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.