-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
27 lines (24 loc) · 1.12 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<html>
<!-- from unpkg -->
<script type="module" src="https://unpkg.com/[email protected]/widget.module.min.js" async defer></script>
<script nomodule src="https://unpkg.com/[email protected]/widget.min.js" async defer></script>t>
<head>
<title>Href Attribute Example</title>
</head>
<body>
<div class="frc-captcha" data-sitekey="FCMGEMUD2NNITJUP" data-start="auto" data-puzzle-endpoint="https://eu-api.friendlycaptcha.eu/api/v1/puzzle" data-callback="addElement"></div>
<script>
function addElement (solution) {
// erstelle ein neues div Element
// und gib ihm etwas Inhalt
var newDiv = document.createElement("div");
newDiv.className = "solution";
var newContent = document.createTextNode(solution);
newDiv.appendChild(newContent); // füge den Textknoten zum neu erstellten div hinzu.
// füge das neu erstellte Element und seinen Inhalt ins DOM ein
var currentDiv = document.getElementById("div1");
document.body.insertBefore(newDiv, currentDiv);
}
</script>
</body>
</html>