Files
pyscript/pyscript.core/tests/manual/test_when.html
Andrea Giammarchi 9f46234f71 Fix #2114 - Cleanup the test folder + automation (#2143)
* Fix #2114 - Cleanup the test folder + automation
* Merged both test and tests into a single folder
2024-08-08 17:08:59 +02:00

25 lines
665 B
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PyScript Next: When Decorator</title>
<link rel="stylesheet" href="../../dist/core.css">
<script type="module" src="../../dist/core.js"></script>
</head>
<body>
<p>Click for a hi!</p>
<py-script>
from pyscript import window, when
@when("click", selector="#say-hi")
def say_hi(event):
window.alert("Hi! 🤗")
</py-script>
<button id="say-hi">Click Me</button>
</body>
</html>