The problem is that the labels have pseudo-elements for the checkboxes so you also need to remove those:
Code:
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
var thisQuestion = $('#question{QID}');
// Remove a checkbox
$('input:checkbox:eq(0)', thisQuestion).remove();
$('td.checkbox:eq(0)', thisQuestion).removeClass('checkbox');
// Remove some text inputs
$('.checkbox-text-item:eq(0) .comment-container', thisQuestion).remove();
$('.checkbox-text-item:eq(1) .comment-container', thisQuestion).remove();
$('.checkbox-text-item:eq(2) .comment-container', thisQuestion).remove();
$('.checkbox-text-item:eq(3) .comment-container', thisQuestion).remove();
$('.checkbox-text-item:eq(4) .comment-container', thisQuestion).remove();
});
</script>
Having said that, there is a ton of garbage HTML in that version so I think you would be better off inserting new table rows as the sub-headers:
Code:
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
var thisQuestion = $('#question{QID}');
// Remove some text inputs
$('.checkbox-text-item:eq(0) .comment-container', thisQuestion).remove();
$('.checkbox-text-item:eq(1) .comment-container', thisQuestion).remove();
$('.checkbox-text-item:eq(2) .comment-container', thisQuestion).remove();
$('.checkbox-text-item:eq(3) .comment-container', thisQuestion).remove();
// Insert sub-headings
$('tr.answer-item:eq(0)', thisQuestion).before('<tr class="inserted-sub-heading"><th colspan=2>Sub-heading 1</th></tr>');
$('tr.answer-item:eq(3)', thisQuestion).before('<tr class="inserted-sub-heading"><th colspan=2>Sub-heading 2</th></tr>');
});
</script>
Sample survey attached: