@w0s/button-confirm
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • Public • Published

Display a confirm() modal dialog when button is pressed

npm version test status

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>

Attributes

data-message [required]
A string you want to display in the confirm() modal dialog.

Readme

Keywords

Package Sidebar

Install

npm i @w0s/button-confirm

Weekly Downloads

4

Version

2.1.0

License

MIT

Unpacked Size

34.4 kB

Total Files

11

Last publish

Collaborators

  • saekitominaga