Reputation: 755
I have a text box with a default text. I am using javascript to dissapear it when the user clicks in this, but i want to make it work without javascript. Is there any way to do that in html or php? Thank you!
Upvotes: 0
Views: 1653
Reputation: 296
it is simple you can use html5 control also.there like.
<input type="text" name="txtFirstName" id="txtFirstName"
placeholder="enter first name" />
Upvotes: 0
Reputation: 78971
In HTML5, there has been the introduction of new attribute called placeholder
You can use it like this
<input type="text" placeholder="text to show and hide" />
Upvotes: 0
Reputation: 32484
It can be done in flat HTML5 using the placeholder
attribute of the <input>
tag
<input type="text" placeholder="Default Text" />
Upvotes: 3