delete element if checkbox checked
Im trying to delete an element if the checkbox inside it is checked.
- if($j(this).find('input[id^="checkbox"]:checked').length == 1)
- {
- var parts = $j('input[id^="checkbox"]:checked').attr('id').split('-');
- $j('input[id^="checkbox"]:checked').each(function(){
- $j('dl#row-'+parts[1]).remove();
- });
- });
however it only removes the last element.
Any ideas?