Need help in correcting errors in this code

Thanks for your help

Without seeing the code it’s impossible to say anything more than what error says. To whatever variable you are trying to set innerHTML, it doesn’t contain what you expect, but it is null.

Hey there,

nice to meet you!

If you provide us:

  • a codepen with your current code
  • a clear description what you want to achieve
  • a clear description what your tried so far and why it didn’t work,

it’ll be much easier to help you.

Hi sanity and Mike,

Thanks for taking the time to reply. I am sorry for not posting the code.
My code may be seen on this link: https://codepen.io/pen/
What I want to achieve is: " This is my personal portfolio. This is my website. There are many like, but this one is mine"
What I have tried so far: I tried using Chrome developer tools to identify the error. I see that the error is in the third line of the JS. But I am not sure what is the error.

I would appreciate it if you could help me understand this better.

that is not the link to your pen, please provide a valid pen link if you want help with a pen

Sorry about that. I am not sure how to post code here. I have attached a screenshot of the code as an image. Many thanks for your patience!

you don’t seem to have an element with id of 'holder'

please, instead of posting a screenshot, post a link to your code
or post your code formatted:

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

Thank you for patience and for sharing resources to help me learn. I appreciate all the help.

1 Like

Thank you for letting me know how to post code here.

1 Like

Like @ilenia said:

<span id="placeholder"></span>

This line of code creates a span with an id of placeholder.

var span_element = document.getElementById('holder');

What you do: You search for an element with an id of holder.
What you actually want to do: You want to search for the above span. It has an id of placeholder.

Can you connect the dots?

Many thanks for the helpful suggestions.