1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21

content / test / data / android / leaf_node_updates.html [blame]

<!-- Simple file to update text data programmatically -->
<html>
  <head>
    <script>
      const textNode = document.createTextNode("");

      function createText() {
        const div = document.querySelector("div");
        textNode.data = "Example text 1";
        div.appendChild(textNode);
      }

      function updateText() {
        textNode.data = "Example text 2";
      }
    </script>
  </head>
  <body onload="createText()">
    <div id="test"></div>
  </body>
</html>