Once again about Placeholders

    Recently, several articles skipped on Habré, which described various ways of implementing tooltips in the input fields ( 1 , 2 ).
    The second method was more to my liking, since its description was to use the placeholder attribute on input elements .
    But one “but” haunted me - the script was based on replacing the value property of an element. It seems to me that this is not entirely correct.
    So, my “bike” is based on a layer overlay with a tooltip on top of the input element . Of course, the obvious minus of this approach is that the DOM tree grows, and the time spent on creating new elements. But then the valueremains "clean."

    Google project http://code.google.com/p/placeholderjs/
    Live example

    Also popular now: