yanny Posted May 26, 2021 Share Posted May 26, 2021 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 More sharing options...
Ingolme Posted May 27, 2021 Share Posted May 27, 2021 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now