Question: I have a code which allows me to add certain "absentees", along with their ID's through a hidden form, to the absentees list when I click on them. When I click on it again, the "absentee" is removed from the absentees list. However, when I click on it again, the list seems to extend further because of a br
in my code plus the hidden form value doesn't seem to be removed. I need the hidden value removed so that the removed absentee from the list will not be recorded in the database. I need the br
so that the absentee listing will be presentable.

Here's my code: <http://jsfiddle.net/gk5pV/8/>

Answer: 
I wholeheartedly agree with @charlietfl, just use a block level element. Also, use a single hidden input to track your absentees. [Example fiddle](http://jsfiddle.net/xXUTp/), code below:

```
$(function() {
    $("td").click(function() {
        var $this = $(this);
        var user = $this.attr('id');
        var p = $('<p />').attr('user', user).text($this.text());
        var absentees = [];
        if ($('#absentees').val().length > 0) {
            absentees = $('#absentees').val().split(',')
        }
        if ($(this).hasClass('on')) {
            //console.log("Already marked absent");
            //remove from collection
            $("#collect").children('p[user="' + user + '"]').remove();
            absentees.splice(absentees.indexOf(user), 1);
        }
        else {
            //console.log(user);
            //add to collection
            $("#collect").append(p);
            absentees.push(user);
        }
        $this.toggleClass('on');
        $('#absentees').val(absentees.join(','));
    });

    $("#clicky").click(function() {
        $('td').removeClass('on');
        $("#collect").empty();
        $('#absentees').val('');
     });
});​

```
Solution is fairly simple. Wrap the text you want to append and hidden input in a block level element ( div, p, li etc) and you won't need a `<br` tag. WHen you remove the absentee from list you remove the block element and the input will be part of it so it will no longer exist. If you give the new block level element a class name you can simply attach your event handler to the class