You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
ozgurkon-site/test-hugo/themes/devfest-theme-hugo/assets/script/subscription.js

16 lines
452 B

// Subscription
$$('form.subscribe').forEach(formElt => {
console.log('subscribe', formElt);
formElt.onsubmit = () => {
const values = Array.from(formElt.elements)
.reduce(
(acc, elt) => {
if (elt.name) {
acc[elt.name] = elt.value;
}
return acc;
},
{});
subscribe(values);
};
});