JSFiddle - React, Tailwind, and code Playground

by saroj1

HTML

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>DOM tree structure</title>
    <script>
      function changeText(){
          let h2Element = document.getElementsByTagName('h2');
          h2Element[0].innerHTML = "Hello World!";
      }
    </script>
  </head>
  <body>
    <h1>DOM tree structure</h1>
    <h2>Learn about the DOM</h2>
    <button type="button" onclick="changeText()">Change Text</button>
  </body>
</html>