Home > Net >  why is the html element not changing
why is the html element not changing

Time:01-02

I linked the html with the javascript and I'm sure everything is okay

let welcomEl = document.getElementById("welcome-el")
let username = "james"
let myGreeting = "Welcome back, "
welcomEl.innerText = myGreeting   username
<div id="welcome-el"></div>
<br/>
<script src="index.js"></script>

CodePudding user response:

I run it and its working ! are you sure its have mistakes?

CodePudding user response:

you didn't mention the id properly.

  • Related