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
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>
+ 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.
+ 1
change "java" tag to "JavaScript" or "js"
0
Hi