Accessible Clear Button For Text Fields - jQuery vamoose

Accessible Clear Button For Text Fields - jQuery vamoose

jQuery PluginsjQuery Form PluginsjQuery vamoose

Accessible Clear Button For Text Fields - jQuery vamoose

The vamoose jQuery plugin adds a custom accessible Clear Button to text fields that allow your users to clear the fields with just one click. Supports both input field and textarea.

Alternative plugins:

How to use it:

1. The plugin uses Font Awesome for the clear icon.

<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">

2. Import jQuery library (slim build) and the jQuery vamoose plugin into the document.

<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" 
        integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" 
        crossorigin="anonymous">
</script>
<script src="jquery.vamoose.js"></script>

3. Call the function on your text fields. Done.

<input type="text" aria-label="field-1">
<input type="text" aria-label="field-2">
<textarea aria-label="textarea"></textarea>
$('input, textarea').vamoose();

This awesome jQuery plugin is developed by ghostrydr. For more Advanced Usages, please check the demo page or visit the official website.

  • Publication date: 29.01.2018
  • Source