Skip to content

Instantly share code, notes, and snippets.

@JeffreyWay

JeffreyWay/demo.html Secret

Created Jun 16, 2020
Embed
What would you like to do?
Alpine.js basic data binding example.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.min.js" defer></script>
</head>
<body>
<div x-data="{ first: 0, second: 0 }">
<input type="text" x-model.number="first"> + <input type="text" x-model.number="second"> = <output x-text="first + second"></output>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.