This package has been deprecated

Author message:

This package has been moved to @w0s/form-before-unload-confirm

@saekitominaga/htmlformelement-before-unload-confirm
TypeScript icon, indicating that this package has built-in type declarations

1.2.6 • Public • Published

Prevent page unloaded while filling out a form

npm version test status

Demo

Examples

<script type="module">
import FormBeforeUnloadConfirm from './dist/FormBeforeUnloadConfirm.js';

for (const formElement of document.querySelectorAll('.js-form-beforeunload-confirm')) {
  const formBeforeUnloadConfirm = new FormBeforeUnloadConfirm(formElement);
  formBeforeUnloadConfirm.init();
}
</script>

<form class="js-form-beforeunload-confirm">
  <p><input /></p>
  <p><button>Submit</button></p>
</form>

Constructor

new FormBeforeUnloadConfirm(
  thisElement: HTMLFormElement
)

Parameters

thisElement [required]
Target element

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Published

Version History

  • Version
    Downloads (Last 7 Days)
    • Published

Package Sidebar

Install

npm i @saekitominaga/htmlformelement-before-unload-confirm

Weekly Downloads

3

Version

1.2.6

License

MIT

Unpacked Size

41.4 kB

Total Files

7

Last publish

Collaborators

  • saekitominaga