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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:40:21+00:00 2026-06-11T03:40:21+00:00

Ok. I need fresh eyes because I’m still on this s***d problem for one

  • 0

Ok. I need fresh eyes because I’m still on this s***d problem for one hour!

Here is my simple HTML code (testssio.html) that include javascript script:

<!DOCTYPE html>
<html>
<head>
    <script type="text/javascript">
        var ssio = document.getElementById('ssio');
        ssio.html = "it finally works!";
    </script>
</head>
<body>
    <div id="ssio"></div>
</body>
</html>

But it doesn’t work! Using the debugger, I get:

Uncaught TypeError: Cannot set property 'html' of null          /testssio/:6

Does anyone get it? I know it’s not the correct place to look for debugging help, but I’ll be crazy if I don’t get it! So please, any help?

Tahnks in advance.

  • 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-11T03:40:23+00:00Added an answer on June 11, 2026 at 3:40 am

    The reason for this is that scripts in the head load before the page is rendered. This means your content is not yet rendered and therefore not a part of document.

    If you want to see this work, try moving your script below the element renders, like this:

    <!DOCTYPE html>
    <html>
    <head>
    </head>
    <body>
    <div id="ssio"></div>
    <script type="text/javascript">
        var ssio = document.getElementById('ssio');
        ssio.innerHTML = "it finally works!";
    </script>
    </body>
    </html>
    

    A more standardized way of doing this is with events. Many people use jQuery but it can be done with plain js. This would mean changing your script like this:

    <script type="text/javascript">
      function WinLoad() {
        var ssio = document.getElementById('ssio');
        ssio.innerHTML = "It finally works!";
      }
      window.onload = WinLoad;
    </script>
    

    This way you can still leave it in the <head>.

    Also, using .html is from jQuery. It is generally used as .html(content). If you want to use the plain javascript version use .innerHTML = content.

    I mention jQuery so much because it is a highly used API. This quote is from their site:

    jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.

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

Sidebar

Related Questions

I am stumped on this and I need some fresh eyes, I'm not sure
I think I just need a fresh set of eyes on this game I'm
I cannot get this function to fire off... I'm thinking I need a fresh
I'm asking this because I am at a complete loss myself and need a
probably the answer is quite silly but I need a pair fresh of eyes
Need some help with this error. Fresh wordpress 2.9 install... Fatal error: Cannot instantiate
Fresh Asking of this Question-> I have a WIX file that I need to
I need a fresh temporary directory to do some work in a shell script.
Need to apply a filter to a file like this: TUPAC_0006:1:1:2554:2356#0/1 0 * 0
Need a map reduce function by mongo in php This my mongo structure [_id]

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.