0
Plz help me to find my problem . I want to change backgroundcolor using the button .sorry I am weak in English .
<!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <button onclick="green()">green</button> <button onclick="yellow()">yellow</button> <script type="text/javascript"> function green(){ document.body.style.backgroundcolor="red" } function yellow(){ document.body.style.backgroundcolor ="yellow" } </script> </body> </html>
6 ответов
+ 4
try to use "backgroundColor"
+ 3
Teostra is correct. Perhaps there are other bugs in your code. It would be better if you post the code link so we can help you better.
Here's a sample code:
https://code.sololearn.com/WlRs554xPoWF/?ref=app
+ 2
COMEDY KING I made another example, compare Jonathan Pizarra's code and mine and see which one is more easy for you to understand.
https://code.sololearn.com/W6M9NhnMMAIH/?ref=app
0
Thanks friends ....
0
No problem
- 1
thanks but it is not working.