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 8467137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:33:22+00:00 2026-06-10T15:33:22+00:00

I need to run my JavaScript Code on Page Start. <body onload=document.getElementById(‘Label1’).style.display = ‘none’;document.getElementById(‘Textbox1’).style.display

  • 0

I need to run my JavaScript Code on Page Start.

<body onload="document.getElementById('Label1').style.display = 'none';document.getElementById('Textbox1').style.display = 'none';">

Currently I’musing a Onload property in Body Tag and using the code in that. By using in this way the code is running after the total page is loaded and it takes some time to make the label and the textbox to disappear.

Is there any way to run this code before the page Loads??

Or some other way in which I can accomplish this ?

(I’m using another JavaScript function to make the Label and Textbox Visible and Invisible basing on a DropdownList SelectedIndex so if I use properties like style=”display:none” I could not make them visible again using 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-06-10T15:33:24+00:00Added an answer on June 10, 2026 at 3:33 pm

    You don’t need to make your html elements invisible with javascript when the page is being loaded. You can set them invisible with css using visibility:hidden or display:none and then set them visible with javascript like this:

    document.getElementById("someobject").style.display="block";
    OR
    document.getElementById("someobject").style.visibility="visible";
    

    Also if you are using jquery you can use

    $(document).ready(function(){
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i need run code that will create a database and populate tables. i am
I need to run an external application from within my Java code. I can
I have some jQuery/JavaScript code that I want to run only when there is
I need to run javascript in php or python or java. My problem is,
So I need to pull some JavaScript out of a remote page that has
I need run ts:reindex when smth add in model or destroy from model. How
I need to run the application that I have made in Xcode on my
I need to run two ffmpeg commands, one after the other i.e., wait until
I need to run application in every X seconds, so, as far as cron
I need to run a script that will generate the projects.list file when a

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.