Placeholder in HTML5

I just came across this super cool HTML5 feature.

How many times did you coded a filler text within an input text field with javascript?

I love HTML5

Now with HTML5 we can create that placeholder in less than a blink of an eye.

Add the attribute and you're ready to go πŸ˜‰

<input placeholder="write your e-mail" type="text" name="first" id="first" />

Supported Browers

Google Chrome and Safari.

Full HTML5 Example

<!DOCTYPE html> <html lang="en"> <head> <meta charset=utf-8 /> <title></title> <body> <form action="" method=""> <fieldset> <legend>Form Name</legend> <p>First Input: <input placeholder="write your e-mail" type="text" name="first" id="first" /></p> </fieldset> <p><input type="submit" /></p> </form> </body> </head> </html>
3 comments

Leave a Reply

Add <code> Some Code </code> by using this tags.

*
*