I have the below code which works until i try dynamically adding more to the DOM. It should allow for rooms to be added, and then allow for items to be added to those rooms. If you try the online version you'll see the hardcoded html one works as planned, but dynamically added ones with append don't. I have tried .live() but it didnt work for me, i may have used it wrong however
$(document).ready(function () {
$('.addItem').on('click', function () {
$('<input type="text"/>').appendTo($(this).siblings('.items'));
});
$('#addRoom').on('click', function () {
var number = 1;
number++;
$('<div class="formHolder">\
<form class="items" rel="' + number + '">\
<input type="text"/>\
</form>\
<div class="addItem">Add Item</div>\
</div>').appendTo('#content');
});
});