Get started with watch CDN

MIT licensed

Watch JS library observes object props, auto-renders React components.

Tags:
  • watch
  • change
  • domattrmodified
  • propertychange
  • polling
  • attributes
  • properties
  • observer

Stable version

Copied!

How to start using watch CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with watch CDN - cdnhub.io</title>
  <script src="https://cdn.cdnhub.io/watch/2.0.4/watch.min.js"></script>
  <script>
    document.addEventListener('DOMContentLoaded', () => {
      const inputEl = document.querySelector('#input');
      const outputEl = document.querySelector('#output');

      watch(inputEl, (value) => {
        outputEl.textContent = `You typed: ${value}`;
      });
    });
  </script>
</head>
<body>
  <input id="input" type="text" placeholder="Type something...">
  <p id="output"></p>
</body>
</html>
Copied!
Copied!
Copied!

All versions