I am looking for a way to clear the old values from text box when I refresh the page using jquery. I tried this code but it didn't work.
$('#flip_list_search').value = "";
Try this
$("#flip_list_search").val('');
Use .val()
$('#flip_list_search').val('');
or
$('#flip_list_search')[0].value ='';
.value
works with native DOM Object $('#flip_list_search')
is jQuery Object
$('#flip_list_search')[0]
to get first native DOM Object
$("input#flip_list_search","#Your_form_Id").val('');
You can use this. It will be more help to detect your element. Here #Your_form_Id is the id that contains your text box. jQuery search your text box only the #Your_form_Id portion in lieu of whole DOM.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With