I’d like to have placeholder text while javascript is on by doing something like the following:
<input id="firstform" type="text" value="Pizza" onblur="this.value=!this.value?'Pizza':this.value;" onfocus="this.select()" onclick="this.value='';" name="firstform">
I’d like to have the field blank if javascript is turned off though, as when javascript is off the placeholder text stays when the field is selected.
Unfortunately I can’t use the HTML5 placeholder attribute instead of all this.
Load the value on page load with JS
that way if the user has JS off, the field will be blank