<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>
-
data-message
[required] - A string you want to display in the
confirm()
modal dialog.