I would like to know how to put a phrase inside a form field, and it disappears when you click inside the field.
Can it be in CSS? What do you do this for?
I would like to know how to put a phrase inside a form field, and it disappears when you click inside the field.
Can it be in CSS? What do you do this for?
There is a property in HTML5 called placeholder
that does what you want.
<input type="text" placeholder="Digite seu nome" />
You can use the placeholder, as stated, or use js and clear the field whenever you click on it.
<input type="text" id="input" value="Value" onClick="func()"/>
<script>
var func= function(){
var elem = document.getElementById("input");
elem.value = "";
}
</script>