+ 16

Why is it showing error[SOLVED]

document.getElementById https://code.sololearn.com/W7OpFpX44RX8/?ref=app

19th Mar 2021, 8:18 AM
Queen👽
Queen👽 - avatar
10 Réponses
+ 6
'b' in 'by' should be capital in your code. Also put this line inside the function. var x= document.getElementById("thrd");
19th Mar 2021, 8:25 AM
Avinesh
Avinesh - avatar
+ 5
Try: put your code in function,and 'b' in 'By' should be capital in your code. function usage(){ var x = document.getElementById("thrd"); x.style.display ="none"; document.body.style.backgroundColor = "white"; }
19th Mar 2021, 8:30 AM
Nature 🌹🌿
Nature 🌹🌿 - avatar
+ 2
Miss the first mistake is var x= document.getElementbyId("thrd"); function usage(){ x.style.display ="none"; document.body.style.backgroundColor = "white"; } That Is in getElementbyId the b should be capital I mean it would be getElementById("thrd");
19th Mar 2021, 8:27 AM
Abhishek Singh
Abhishek Singh - avatar
+ 2
Ambicaa[space🚀🌌Exams] document.getElementById() is case sensitive
19th Mar 2021, 8:27 AM
R🍁🇮🇳
R🍁🇮🇳 - avatar
+ 2
You need to make block
19th Mar 2021, 8:30 AM
Michael
Michael - avatar
+ 2
Item.style.display = "block"
19th Mar 2021, 8:30 AM
Michael
Michael - avatar
+ 2
Item.style.display = "none"
19th Mar 2021, 8:34 AM
Michael
Michael - avatar
+ 1
Kankan Mayang how's this from anywhere telling why there is error I don't think so
21st Mar 2021, 6:29 AM
Abhishek Singh
Abhishek Singh - avatar
21st Mar 2021, 5:56 AM
Kankan Mayang
Kankan Mayang - avatar