I have no earlier jQuery mobile experience, and now I am trying to add new checkbox dynamically in javascript.
Using (in html head)
jquery.mobile-1.4.5.min.css
jquery-1.11.3.min.js
jquery.mobile-1.4.5.min.js
part of HTML:
<form>
<fieldset data-role="collapsible">
<div id="agree" data-role="controlgroup"></div>
<input type="submit" value="Submit">
</fieldset>
</form>
part of JAVASCRIPT:
var html = '<input type="checkbox" name="checkbox-1" id="checkbox-1" /><label for="checkbox-1">I agree</label>';
$('#agree').html(html);
$("input[type='checkbox']").checkboxradio("refresh");
I am getting only plain checkbox, no any formatting. What is wrong? Am I missing something?