How to create a label inside an <input> element?
I would like to insert a descriptive text inside an input element that disappers when the user click on it. I know it is a very common trick, but I do not know how to do that.. What is the simplest/better solution? <input name="searchbox" onfocus="if (this.value=='search') this.value = ''" type="text" value="search"> A better example would be the SO search button! That's where I got this code from. Viewing page source is a valuable tool. If you're using HTML5, you can use the placeholder attribute. <input type="text" name="user" placeholder="Username"> In my opinion, the best solution involves