Data Attributes

Use data attributes to apply JavaScript to Clique.UI components

You can use all Clique.UI components by just adding data-* attributes to your HTML elements without writing a single line of JavaScript. This is Clique.UI's best practice of using its components and should always be considered first.

Markup

<button data-button>My Button</button>

Initializing a component with the data-* attribute is the same as manually initializing it:

Markup

via the jQuery API
$("#my-button").clique("button", {
    // Options...
});
via the Clique.UI API
Clique.button("#my-button", {
    // Options...
});