$('#containerId').append('<input type="checkbox" name="myCheckbox" />');
where containerIdis the identifier of the DOM element to which you want to add this flag.
Or alternative syntax ...
$('#containerId')
.append(
$(document.createElement('input')).attr({
id: 'myCheckbox'
,name: 'myCheckbox'
,value: 'myValue'
,type: 'checkbox'
})
);
source
share