+ 2
I have two exactly the same web documents, but they don't output the same. What is my problem?
I worked on a countdown, and wanted to use "innerHtml". But it didn't worked and so I looked to other web codes using "innerHtml" and copied one. I deleted all I didn't need, and it worked! https://code.sololearn.com/Wp59zfu34HsY/?ref=app https://code.sololearn.com/W6FU9GYWmMtn/?ref=app Please comment if both output "b" on your smartphone etc. or not and if you know such problems, please comment it too.
3 Respostas
+ 8
Your problem is innerHTML , but not innerHtml.
right variant:
window.onload = function() {
var x = document.getElementById("p");
x.innerHTML= "b";
}
false variant:
window.onload = function() {
var x = document.getElementById("p");
x.innerHtml= "b";
}
+ 2
in the second one you use x.innerHtml instead of x.innerHTML thats why the content doesn't change
+ 1
I'm confused