@w0s/button-confirm
v2.1.0
Published
Display a `confirm()` modal dialog when button is pressed
Downloads
19
Readme
Display a confirm()
modal dialog when button is pressed
Demo
Examples
<script type="importmap">
{
"imports": {
"@w0s/button-confirm": "..."
}
}
</script>
<script type="module">
import ButtonConfirm from '@w0s/button-confirm';
for (const targetElement of document.querySelectorAll('.js-button-confirm')) {
new ButtonConfirm(targetElement);
}
</script>
<form>
<p>
<button class="js-button-confirm"
data-message="Message text"
>Submit</button>
</p>
</form>