Question 03 of 05

DOM Manipulation

Create a page that changes element content dynamically using JavaScript DOM manipulation.

C++
<!DOCTYPE html>
<html>
<body>
    <p id="demo">Original Text</p>
    <button onclick="changeText()">Click Me</button>
    <script>
        function changeText() {
            document.getElementById("demo").innerHTML = "Text Changed!";
            document.getElementById("demo").style.color = "red";
        }
    </script>
</body>
</html>
Question 3 of 5