HTML5 form attributes
There are 14 new attributes that we’ll be looking at in this article. placeholder autofocus autocomplete required pattern list multiple novalidate formnovalidate form formaction formenctype formmethod formtarget placeholder First up is the placeholder attribute, which allows us to set placeholder text as we would currently do in HTML4 with the value attribute. It should only be used for short descriptions. For anything longer, use the title attribute. The difference from HTML4 is that the text is only displayed when the field is empty and hasn’t received focus. Once the field receives focus (e.g., you click or tab to the field), and you begin to type, the text simply disappears. Let’s have a look at how to implement the placeholder attribute. <input type = "text" name = "user-name" id = "user-name" placeholder = "at least 3 characters" > But as control get focus, placeholde...