The entry point for the character counter. It adds a simple character to input and textarea elements.

Hierarchy

  • InputElementCounter

Index

Properties

destroy

destroy: function

Removes the character counter from an input or text area element. You must have called init before you call this method.

param

Elements with a character counter to destroy.

Type declaration

init

init: function

This function initializes an input or textarea element with a character counter that keep tracks of how many characters the users has entered.

param

the elements on which to initializes the character counter

param

optional settings for the character counter

Type declaration

isInitialized

isInitialized: function

Checks whether a character counter was initialized for the first given input or textarea via init.

param

Element with a character counter to check.

returns

Whether a character counter was already initialized.

Type declaration

update

update: function

Update the counter for an input or textarea that was added via init. Normally this is not required as the counter updates automatically, but sometimes you may need to do this manually, e.g. when setting the value of the counter manually via script.

param

Elements with a character counter to update.

Type declaration