Enables flexible placeholders that are simple to style and modify.
It modifies the input elements by wrapping them in a container that holds the input element, as well as a span tag containing the placeholder text. If something is entered into the textbox, the placeholder text is hidden, if the text is removed the placeholder is restored.
##Example usage
<input type="text" id="firstName" name="firstName" placeholder="Mike" />
<!-- Gets converted to: -->
<span class="input-holder">
<input type="text" id="firstName" name="firstName" />
<span class="input-default">Mike</span>
</span>
$('input').placeholder();
Since input-holder and input-default classes are added to the span tags you can style them with something similar to:
.input-holder {
position: relative;
}
.input-default {
color: #ccc;
position: absolute;
top: 1px;
left: 5px;
}
$('input').placeholder({
clearOnFocus: true //default: false. When enabled, it will clear the text when the element is focused on
});