Get started with x-tag CDN

MIT licensed

X-Tag: Lightweight JS templating engine for efficient HTML creation, updates.

Tags:
  • x-tag
  • core
  • W3C

Stable version

Copied!

How to start using x-tag CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with x-tag CDN - cdnhub.io</title>
  <script src="https://cdn.jsdelivr.net/npm/x-tag@1.5.11/dist/x-tag-core.min.js"></script>
  <style>
    :root {
      --tag-prefix: x-;
    }
  </style>
</head>
<body>
  <x-template id="my-component">
    <div class="component">
      <h1>Hello, {name}!</h1>
      <button x-on:click="handleClick">Click me!</button>
    </div>

    <script type="text/x-template">
      const handleClick = () => {
        alert('Button clicked!');
      };
    </script>
  </x-template>

  <x-render src="my-component" name="John Doe"></x-render>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!

All versions