0
What is wrong with this code?
I'm trying to change the text in a paragraph with the onclick event, it won't just work š¤¦š¤¦ <!DOCTYPE html> <html> <head> </head> <body> <p id="intro">personal details</p> <button type="button" onclick="change()">click</button> <script type="text/javascript"> function change() { getElementById("intro").innerHTML="this paragraph is changed"; } </script> </body> </html>
3 Answers
+ 4
https://code.sololearn.com/WK7Pxdh00tI2/?ref=app
Don't forget document.
+ 2
Thanks, it worked
+ 1
It should be-
document.getElementById()...