When I click on a checkbox, I append some content to a div (#item\_list)

```
    if(cb_new.prop('checked')) {
        $("#item_list").append("<input type='hidden' name='post[]' value="+ this.value +">");

    } else {            
        // ??           
    }

```

When I uncheck the box I want that exact same string to be removed from the div. Keeping all the others that have a different value (this.value).

So for example I could have:

```
<div id="item_list"> 
<input type="hidden" name="post[]" value="102">
<input type="hidden" name="post[]" value="93">
</div>

```

But if I uncheck

```
<input type="checkbox" id="d-102-2" name="d-102" value="102" data-id="d-102"> 

```

I want :

```
<div id="item_list"> 
<input type="hidden" name="post[]" value="93"> 
</div>

```

If I check it again, I want it back.

How can I do that?