HTML5: old school vs. new school
// May 12th, 2011 // No Comments » // labs
A time ago post a JavaScript snipet. It was simple snipet that provides a hint that describes the expected value of an input field. So, when text input get focus, the default value disappears and allows the user to write, but if the user doesn’t type anything, the default value returns to the input text when the input lose the focus. But the last week I was reading the book HTML5: Designing Rich Internet Applications, and I found some great new attributes.
One of them is the Placeholder attribute, which works exactly as my snipet(well, my snipet add an extra class to the input when get focus, but that is not always necessary). If your browser support HTML5 you can test it here:
Apart of this one, there are other new great features in HTML5 that I going to talk about in the future, as I think that HTML5 help making easy many task that ussualy were more complex and required the use of HTML, CSS and JavaSctip. Meanwhile you can start checking some of them in w3schools.
