I have a field called 'inputaddress' which a user types address details into, so they can perform a google map geocode.
What I would like to do is when the user clicks on the 'searchfortheaddress' button, it will perform the geocode but will then clear the 'inputaddress' field.
Could someone perhaps tell me please how I can clear the field.
To clear all the input in an HTML form, use the <input> tag with the type attribute as reset.
document.getElementById("inputaddress").value = '';
Would $('#inputaddress').html("");
or document.getElementById('inputaddress').value=""
work?
document.getElementById("inputaddress").value = '';
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