placeholder

Methods

static generate(selectedTargets, optionsopt)

Generate virtual placeholders.

Parameters:
Name Type Attributes Description
selectedTargets HTMLCollection | Array.<HTMLElement>

Selected elements for generating placeholder

options object <optional>

options

Properties
Name Type Attributes Default Description
wrapperClassName string <optional>

wrapper class name

usageStatistics boolean <optional>
true

Send the hostname to google analytics. If you do not want to send the hostname, this option set to false.

Example
var placeholder = tui.placeholder; // require('tui-placeholder');

placeholder.generate();
placeholder.generate(document.getElementsByTagName('input'));
placeholder.generate(document.getElementsByTagName('input'), {
    wrapperClassName: 'my-class-name'
});

static hide(selectedTargets)

When 'input' or 'textarea' element already has value, hiding the virtual placeholder

Parameters:
Name Type Description
selectedTargets HTMLCollection | Array.<HTMLElement>

Selected elements for generating placeholder

static remove(selectedTargets)

Clear generated placeholders.

Parameters:
Name Type Description
selectedTargets HTMLCollection | Array.<HTMLElement>

Selected elements for generating placeholder