+ 1

javascript . Code not working after F5. help!

<!DOCTYPE html> <html> <head> <meta name="viewpoint" content="width=device-width, initial-scale=1.0"> </head> <body> <h1> My First JavaScript</h1> <p id="demo"> JavaScript can change the style of an HTML element </p> <script> function myFunction() { document.getElementById("demo").style.fontSize="25px"; document.getElementById("demo").style.color="red"; documet.getElementById("demo").style.backgroundColor="yellow"; } </script> <button type="button" onclick="myfunction()">Click Me!</button> </body> </html>

8th May 2020, 2:27 PM
David
4 Answers
0
myFunction should be myfunction
8th May 2020, 2:36 PM
Abhay
Abhay - avatar
+ 1
Document spelling is wrong.
8th May 2020, 2:34 PM
James Clark I. Vinarao
James Clark I. Vinarao - avatar
0
Okay thanks. Corrected but still no changes
8th May 2020, 2:36 PM
David
0
Thanks Abhay! It worked
8th May 2020, 2:37 PM
David