website/js/customElements/contactMailButton.js
2021-05-24 18:19:25 +02:00

15 lines
No EOL
477 B
JavaScript

class contactMailButton extends HTMLElement {
constructor() {
super();
this.addButton();
}
async addButton(){
let sitekey = await (await fetch("/API/config.php?name=sitekey")).text();
console.log(sitekey);
this.innerHTML = `E-Mail: <button id="emailButton" class="h-captcha" data-sitekey="${sitekey}" data-callback="onSubmit">laden</button><br>`;
}
}
customElements.define("jl-contact_mail_button", contactMailButton);