@sonicgarden/leave-check-form-element
v0.1.1
Published
Confirm to leave the page when editing a form.
Downloads
212
Keywords
Readme
<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.