Why is it showing error[SOLVED] | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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
13 Answers
+ 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
+ 3
r 🌺🇮🇳 i Realized the mod answered right first so my fault.
19th Mar 2021, 8:41 AM
Jsçk~⚂
Jsçk~⚂ - 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
Ambicaa[space🚀🌌Exams] oh yeah mark him i was wrong
19th Mar 2021, 8:40 AM
Jsçk~⚂
Jsçk~⚂ - 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
19th Mar 2021, 8:30 AM
Jsçk~⚂
Jsçk~⚂ - avatar
- 2
https://code.sololearn.com/cAf3m22Zzgqi/?ref=app
21st Mar 2021, 5:56 AM
Kankan Mayang
Kankan Mayang - avatar