Download
Version 0.9.4Version 0.9.2
Demo
Text:Password:
Textarea:
Description
Plugin commonly works like placeholder attribute for input fields in Safari and Chrome browsers. Text, password, and textarea fields supported.Options
Option | Default value | Description | Sample code |
placeholded_class | "placeholder" | Placeholded class name. | |
caption_prefix | "" | String caption prefix. | |
caption_postfix | "" | String caption postfix. | |
container | false | Add placeholder attribute to input and textarea tags inside specific containers. This may be useful, when using input tags, generated by CMS or php code and no posibility to add placeholder attribute. | <div class="form-field-container"> <div class="form-field-caption" style="display: none">Input caption</div> <input type="text" name="name" value="" /> </div> |
container_selector | ".form-field-container" | Container selector. Applicable when container: true. | |
caption_selector | ".form-field-caption" | Selector of caption inside container. Applicable when container: true. |
Sample custom calls
Use container:$(":input[placeholder], textarea[placeholder]").placeholder({container: true});
Use custom placeholded class
$(":input[placeholder], textarea[placeholder]").placeholder({placeholded_class: "my-placeholder"});
Only inputs with default parameters:
$(":input[placeholder]").placeholder();