jquery how to empty input field jquery how to empty input field jquery jquery

jquery how to empty input field


You can clear the input field by using $('#shares').val('');


$(document).ready(function(){  $('#shares').val('');});


To reset text, number, search, textarea inputs:

$('#shares').val('');

To reset select:

$('#select-box').prop('selectedIndex',0);

To reset radio input:

$('#radio-input').attr('checked',false);

To reset file input:

$("#file-input").val(null);