0.1.1 • Published 1 year ago

@sonicgarden/leave-check-form-element v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

<leave-check-form> element

Confirm to leave the page when editing a form.

Installation

$ npm install --save @sonicgarden/leave-check-form-element

Usage

Script

Import as ES modules:

import '@sonicgarden/leave-check-form-element'
<leave-check-form>
  <form>
    <select name="country">
      <option>United States</option>
      <option>Canada</option>
      <option>Mexico</option>
    </select>
    <textarea name="comment"></textarea>
    <input type="submit" value="submit">
  </form>
</leave-check-form>

Browser support

Browsers without native custom element support require a polyfill.

  • Chrome
  • Firefox
  • Safari
  • Microsoft Edge

License

Distributed under the MIT license. See LICENSE for details.