Refresh “aria-pressed” of UI Buttons with Markup / Style

http://stackoverflow.com/questions/5641407/refresh-aria-pressed-of-ui-buttons-with-markup-style

by Aline Matos

HTML

<link rel="stylesheet" href="//code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
<div id="format">
	<input type="checkbox" value="1" id="check1"><label for="check1">Sobre</label>
	<input type="checkbox" value="2" id="check2"><label for="check2">Politica</label>
	<input type="checkbox" value="3" id="check3"><label for="check3">Outros</label>
    <input type="checkbox" value="4" id="check4"><label for="check4">Outros</label>
</div>

CSS

body {
	font-family: "Trebuchet MS", "Helvetica", "Arial",  "Verdana", "sans-serif";
	font-size: 62.5%;
}
#format { 
    margin-top: 2em; 
}

JavaScript

$("#format").buttonset();    

var myhappyidtest = 2;

$('#format input[value="' + myhappyidtest + '"]').attr('checked', true).button('refresh');