I have written some HTML code that utilizes jQuery to manage checkboxes.
<tr>
<td>
<div class="checkbox">
<label><input type="checkbox" id="checkbox2"></label>
</div>
</td>
<td><p id="taks2">Task 2</p></td>
<td><span class="glyphicon glyphicon-trash"></span></td>
</tr>
Here is the jQuery script:
<script>
$(document).ready(function(){
$('#checkbox2').click(function(){
if($(this).is(":checked")){
$('#taks2').replaceWith('<s>' + $('#task2').text() + '</s>');
}
else if($(this).is(":not(:checked)")){
}
});
});
</script>
If a user checks the checkbox, "Task 2" will be strikethrough text (output using del or strike tag). If the checkbox is unchecked, it will revert back to "Task 2".