API Docs for: HTML-14.04-dev~bzr202

Class UbuntuUI.Button

Class defined in: buttons.js:23

A Button.

Note the Ubuntu CSS style classes: <em>positive</em>, <em>information</em>, <em>secondary</em>, and <em>negative</em>

UbuntuUI.Button( )
buttons.js:23
Example
 <button data-role="button" id="buttonID">text</button>
    
     Javascript access:
     var button = UI.button("buttonID");
click( callback )
buttons.js:42

Associate a function with the button's Click event

Parameters:
  • callback <Function>
    • The function to execute on click
Example
   UI.button("buttonid").click(function(){
                    console.log("clicked");
                   });
DOMElement element( )
buttons.js:57

Returns the DOM element associated with the id this widget is bind to.


Returns: <DOMElement>
Example
   var mybutton = UI.button("buttonid").element();