function clearDefault(el) { if (el.defaultValue==el.value) el.value = "" } // Then call this function using the 'onfocus' value of your input box: <input value="Your Comment" onfocus="clearDefault(this)" type="text">