0
How to change HTML contents through JavaScript
I am trying to display contents to html through JavaScript but I keep getting error messages Please check the code below and tell me where I went wrong https://code.sololearn.com/WBQG15I6Filf/?ref=app
3 Antworten
+ 2
This error actually happens alot. Your code is correct, but you have to include this in the Javascript tab:
window.onload = function()
{
//place your code here
}
This is needed because otherwise, the Javascript code will run before the HTML, and an error will be returned since "amount" doesn't exist yet.
+ 1
Jianmin Chen thanks, that worked perfectly fine 😁
0
You use. Css to change content and JavaScript for motions and interaction