+ 1

Javascript quiz part

Help me I'm new to coding I'm trying to learn javascript..in this code I want that whenever someone click on the right answer button will change its color to green and if someone click on wrong answer it will turn to red I have tried but don't know how to do it correctly.. https://code.sololearn.com/W0I0B3W3eGx8/?ref=app

5th May 2020, 7:13 PM
Shubham Thakur
Shubham Thakur - avatar
4 Answers
+ 4
result() is a function so you should write onclick = "result()" document.Elementbyclassname=('btn') should be document.getElementsByClassName('btn')
5th May 2020, 9:29 PM
A͢J
A͢J - avatar
+ 1
Wow thankyou mate😍
6th May 2020, 10:16 AM
Shubham Thakur
Shubham Thakur - avatar
0
It is now showing an error
6th May 2020, 1:33 AM
Shubham Thakur
Shubham Thakur - avatar
0
Thankyou as I have just started learning it I m very confuse of how this works ..and also what you have done is not understandable to me..but what you have done was I wanted to do.
6th May 2020, 10:24 AM
Shubham Thakur
Shubham Thakur - avatar