Jump to content

help me please


yanny

Recommended Posts

i'm trying to do my work for school i have to change the background color if the right answer is checked but when i use this line of js code nothing works 

 

 document.getElementById('1').style.backgroundcolor = 'green'
Link to comment
Share on other sites

backgroundColor needs a capitalized C.

IDs are not permitted to begin with a number, but I think browsers might still work if you do that. I would recommend fixing the ID anyway.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...