Append Radio to Controlgroup Dynamically
Description
The following code shows how to append Radio to Controlgroup Dynamically.
Example
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.9.1.js'></script>
<script type="text/javascript"
src="http://code.jquery.com/mobile/1.3.0-beta.1/jquery.mobile-1.3.0-beta.1.js"></script>
<link rel="stylesheet" type="text/css"
href="http://code.jquery.com/mobile/1.3.0-beta.1/jquery.mobile-1.3.0-beta.1.css">
<script type='text/javascript'>//<![CDATA[
$(window).load(function(){<!-- w w w. jav a 2 s. co m-->
$("button").on('click', function () {
$("[data-role=controlgroup]").append('<label><input type="radio" name="radio-choice-0" id="radio-choice-0a">Dynamic</label>');
$('[type=radio]').checkboxradio().trigger('create');
$('[data-role=controlgroup]').controlgroup().trigger('create');
});
});//]]>
</script>
</head>
<body>
<button>Push me!!!</button>
<div id="div_for_harakteromenklatury_list_ff">
<br />
<fieldset data-role="controlgroup" id="test">
<label> <input type="radio" name="radio-choice-0"
id="radio-choice-0a" />Static
</label>
</fieldset>
</div>
</body>
</html>