Button

Other topics

Basic usage

Create an input (or button, or anchor) html element and call button() method of jQuery UI.

<script>
$(function() {
    $( "#myButton" ).button();
});
</script>

HTML

<input type="button" value="A button" id="myButton">

Syntax:

  • $( ".selector" ).button();
  • $( ".selector" ).button({ disabled: true });
  • $( ".selector" ).button({ icons: { primary: "ui-icon-gear", secondary: "ui-icon-triangle-1-s" } });
  • $( ".selector" ).button({ label: "custom label" });
  • $( ".selector" ).button({ text: false });

Parameters:

ParameterType - Details - Default
disabledBoolean - Disables the button if set to true - false
iconsObject - Icons to display - { primary: null, secondary: null }
labelString - Text to show in the button - null
textBoolean - Whether to show the label - true

Contributors

Topic Id: 4600

Example Ids: 16157

This site is not affiliated with any of the contributors.