In a script tag
<body>
<div id="someId"><div>
<script src="dist/multiple-email-form.min.js"></script>
<script>
shareForm.setup(document.getElementById('someId'));
</script>
</body>
As an import
import { setup as shareForm } from "./share-form.js";
shareForm(document.getElementById("email"))
Will add a randomEmail
shareForm.randomEmail()
Will give you the current email count
shareForm.emailCount()
- Paste emails separated by a comma will add them in the form
- While typing add an email by hitting the
,
orEnter
key, the focus will persist so you can proceed with typing. - When loosing focus will also add an email
- Component can be used with the keyboard
- examples can be found here