Answers for "add button to clear input"

0

clear the input when change the radio button

$('input[name="am_payment"]').on('click', function() {
   if ($(this).val() === '') {
      $('#theamount').val('').prop("removed", true).focus();
   }
   else {
      $('#theamount').val('').prop("disabled", false);
   }
});
Posted by: Guest on November-05-2020
0

add clear button to text input

<input type="search" placeholder="Search..."/>

<style>
  input[type=search]::-webkit-search-cancel-button {
    -webkit-appearance: searchfield-cancel-button;
  }

  input[type=search] {
      -webkit-appearance: none;
  }
</style>
Posted by: Guest on December-01-2020

Browse Popular Code Answers by Language