Disable buttons in jQuery Mobile
Live Example: http://jsfiddle.net/XRjh2/16/
UPDATE:
Example link button:
Js
var clicked = false; $('#myButton').click(function() { if(clicked === false) { $(this).addClass('ui-disabled'); clicked = true; alert('Button is now disabled'); } }); $('#enableButton').click(function() { $('#myButton').removeClass('ui-disabled'); clicked = false; });
HTML
<div data-role="page" id="home"> <div data-role="content"> <a href="#" data-role="button" id="myButton">Click button</a> <a href="#" data-role="button" id="enableButton">Enable button</a> </div> </div>
NOTE: - http://jquerymobile.com/demos/1.0rc2/docs/buttons/buttons-types.html
The links created as buttons have all the same visual parameters as the true ones based on the shape of the button below, but there are several important differences. Link-based buttons are not part of the button plugin and simply use the basic buttonMarkup plugin to create button styles so that the button methods of the form (enable, disable, update) are not supported. If you need to disable a button based on a link (or any element), you can use the disabled ui-disabled class yourself using JavaScript to achieve the same effect.
source share