JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css">
<script src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Focus Test</title>
</head>
<body>
<div data-role="page">
<div data-role="header">
<h1>Focus Test</h1>
</div>
<div data-role="content">
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<legend>Agree to the terms:</legend>
<input type="checkbox" name="checkbox-1" id="checkbox-1" class="custom" />
<label for="checkbox-1">I agree</label>
<input type="checkbox" name="checkbox-2" id="checkbox-2" class="custom" />
<label for="checkbox-2">No, Thanks</label>
</fieldset>
</div>
<a data-role="button" id="focus">Set Focums on 2nd Entry</a>
<a data-role="button" id="blur">Blur</a>
</div>
</div>
</body>
</html>
JavaScript
function resetButton(button) {
setTimeout(function() {
$(button).removeClass('ui-btn-active');
}, 500);
}
$(document).ready(function () {
$("a[data-role='button']").live('click', function() {
resetButton($(this));
});
$('#focus').bind('click', function() {
$('#checkbox-2').focus();
});
$('#blur').bind('click', function() {
$('.custom').blur();
});
});