0

I have some problem I can't solve this problem

I can't make it java script ..click here tab .here is link https://code.sololearn.com/W4od2ovaDY2p/?ref=app https://www.sololearn.com/discuss/3194558/?ref=app

26th Feb 2023, 12:49 PM
Nazifa Tasneem
4 Réponses
+ 1
There are a few syntax errors in your code. Here's a corrected version: <!DOCTYPE html> <html> <head> <title>JavaScript</title> </head> <body> <p id="ptag">This is very sweet</p> <button type="button" onclick="myFunction()">Click me</button> <script> function myFunction() { document.getElementById("ptag").innerHTML = "Is someone"; } </script> </body> </html>
26th Feb 2023, 12:54 PM
Last
Last - avatar
+ 1
Changes made: Fixed a typo in the opening p tag: pid changed to id. Added the function name myFunction in the onclick attribute of the button. Removed the extra curly braces {} around the function and the document.getElementById statement. Added quotes around the string "Is someone" in the innerHTML assignment.
26th Feb 2023, 12:55 PM
Last
Last - avatar
+ 1
change "java" tag to "JavaScript" or "js"
26th Feb 2023, 1:03 PM
Last
Last - avatar
0
Hi
27th Feb 2023, 5:56 PM
Aarnold C
Aarnold C - avatar