Clear form using jQuery

Clear textbox

$(':text').val('');

Clear hidden textbox

$(':hidden').val('');

Clear password field

$(':password').val('');

Clear textarea

$('textarea').val('');

Reset selectbox to first option

$('select').val($('select option:first').val());

Happy coding!

Comments