Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Level 1 > lesson 2

i am not able to find the correct answer
by

1 Answer

kshitijrana14
Try this one:

<!doctype html>
<head>
<title>Javascript with HTML</title>
<script>
/ JS in the head section /
function doSomething() {
document.getElementById("heading").textContent = "New heading";
}
</script>
</head>
<body>
<h1 id="heading">Some Page Heading</h1>
<bu/tton onclick="doSomething()">Click me!</b/utton>
</body>
</html>

Login / Signup to Answer the Question.