I have a form, I want to :
1- Put a name inside as default
2- When someone clicks in the form, the default text gets outs and they can write. When they click outside the text that they have written is still there to be send.
3- When someone clicks outside without writing anything the default name comes back
I have tried: onblur=”(this.value=’nom’) But when the user writes and he clicks outside, what he wrote is deleted.
<form>
<input type="text" name="titol" value="nom" onClick="(this.value='')" " />
</form>
I have the example here:
http://jsbin.com/aposun/1/edit
Modify your input:
In HTML5 you could use
placeholderinstead: