pistachiomatt / Precedent.js

A better, polished placeholder script— with semi-placeholder support.

Home Page:http://clients.madebycanvas.com/testbed/precedent.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Precedent.js

Because every other placeholder script was terrible.

Standard placeholdering

For an iOS/Lion-style placeholder in which the placeholder appears and disappers at the last appropriate moment, set the placeholder attribute normally and:

<input placeholder="Sally Sparrow"/>

$('input').precedent();

(You can then style .placeholder with CSS.)

Semi-placeholdering

To offer some pre-filled content and have the rest as a placeholder suggestion, add the attribute semiplacehold:

<textarea semiplacehold placeholder="You're receiving this email because you're a wonderful customer">
  You're receiving this email because 
</textarea>

$('textarea').precedent();

The value will be pre-filled, editable text; and different end-bit in placeholder will be offered as a placeholder suggestion.

About

A better, polished placeholder script— with semi-placeholder support.

http://clients.madebycanvas.com/testbed/precedent.html


Languages

Language:JavaScript 100.0%