Use the innerHTML property to change the content of the <p> element to "New text!". - Javascript DOM

Javascript examples for DOM:Quiz

Description

Use the innerHTML property to change the content of the <p> element to "New text!".

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>

<script>
document.getElementById("demo").innerHTML = "New text!";
</script>//from w  ww .ja  va  2 s . co m

</body>
</html>

Related Tutorials