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

  • SEARCH
  • Home
  • 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 3802192
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:10:10+00:00 2026-05-19T14:10:10+00:00

I have a label and a div called menu that is currently invisible. I

  • 0

I have a label and a div called “menu” that is currently invisible. I want that when the user clicks the label. It will make the div visible. I thought of doing it through javascript, how do I make a control visible through javascript?

  • 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-19T14:10:11+00:00Added an answer on May 19, 2026 at 2:10 pm

    First, if you want to access controls on the client-side, they must be rendered as html. When you use Control.Visible it won’t be rendered on the client and is only accessible on the serverside. Therefore you have to use CSS to toggle it’s visibility on the clientside.

    show the div:

    document.getElementById('menu').style.display = 'inherit';
    

    You could hide it with:

    document.getElementById('menu').style.display = 'none';
    

    You should keep in mind that the id of serverside-controls could change when it’s inside of an other NamingContainer than the page(f.e. in a GridView or UserControl). So you should use Control.ClientID to get the correct ID that’ll be generated from ASP.Net:

    So this is better:

    document.getElementById('<%= menu.ClientID %>').style.display = 'none';
    

    In ASP.Net 4.0 it’s possible to customize the ClientID. For further informations:

    • http://www.thereforesystems.com/working-with-client-id-in-asp-net-4/
    • http://msdn.microsoft.com/en-us/library/system.web.ui.control.clientid.aspx
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a loop that when it is called, creates a div with some
Currently, I have a button called 'Comment' that when clicked slides down a comment
Ok, I have a label, inside this label is a div, which contains an
If I have a drop down list as follows <div class=editor-label> <%= Html.DropDownListFor(model =>
I have small page which has label, DropDownList and a submit button. <div> <asp:label
I have a form element defined as: <div class=field> <div class=name> <label for=User_LastName> Last
So I have some html like so: <div id=avatar_choices> <label for=id_choice_0> <input id=id_choice_0 type=radio
Suppose to have a code like this: <div class=notSelected> <label>Name <input type=text name=name id=name
I have a label that is sometimes empty. How do I set up a
I have a controller called votes_controller.rb . In that file there is the following

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.