Code works in another browser
$("div").append("<input id='post_category' value='item' type='checkbox' checked='checked'>");
Solution To insert a checkbox as indicated in ie7
var category_checkbox = $("<input>").attr({'name' : 'post_category[]' , 'id' : 'post_category' , 'type' : 'checkbox' , 'value' : '1'});
$("div").append(category_checkbox);
category_checkbox.attr({'checked' : 'checked'})
IE7 will not accept a valid attribute when inserting elements. therefore, after adding a check box, select this check box and set the attribute as checked.
source
share