开发者

Live 'required fields' with labels inside of the inputs

Basically what I'm trying to do is to write inside of the inputs something like "Field is Required" after the first time they press inside or when they try to submit. I want it to show directly after they press somewhere else or submit without any refreshes.

So basically i need a suggestion for some lines of code (I want it to be the simplest and light-weight it can be) or maybe a suggestion for some kind of little plugin without too much options in it, all the stuff i found on Google made me totally mad cause 开发者_开发技巧all of them has too many functions and stuff i don't need...

Thanks!


With HTML5 you can specify a "placeholder text" inside the input tags:

<form>
<input name="q" placeholder="Search Bookmarks and History">
<input type="submit" value="Search">
</form>

Makes the search field have that greyed out text that disappears when you click on it.

Source: http://diveintohtml5.ep.io/forms.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜