30 lines
796 B
HTML
30 lines
796 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Captcha</title>
|
|
<script type="module" src="simple-captcha.js"></script>
|
|
</head>
|
|
<body>
|
|
<form id="myForm">
|
|
<!-- Call the custom element, it will handle all the graphics stuff -->
|
|
<simple-captcha id="captcha"></simple-captcha>
|
|
</form>
|
|
|
|
<script type="module">
|
|
// handle stuff here
|
|
// something like a blog submit thing, that would be cool imo!
|
|
const captcha = document.getElementById("captcha");
|
|
|
|
captcha.addEventListener("valid", () => {
|
|
alert("correct!");
|
|
});
|
|
|
|
captcha.addEventListener("invalid", () => {
|
|
alert("wrong!");
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|