onclick to clear form fields JavaScript <p>I hope this question isn't duplicating something in the archives; I've looked but can't find an answer that solves my problem because I seem to be following the advice given.</p> <p>I am making a dynamic form with JavaScript and would like to clear the prompts in each field when a user clicks in it. Here is part of what I have for one of the form fields. I can't figure out why onlick="this.value=' '"; isn't working. Any help would be much appreciated.</p> <pre><code> var VMake1 = document.createElement("input"); VMake1.name = "veh_1_make"; VMake1.type = "text"; VMake1.value= "Please enter the make of vehicle 1"; if (VMake1.value=="Please enter the make of vehicle 1") { onclick="this.value=''"; } placeVeh1Make.parentNode.insertBefore(VMake1,placeVeh1Make); </code></pre> <p>Thank you in advance for your help.</p>