My application allows users to add / remove objects to the DOM. (Click a shape to add one, click the added-shape to remove it.)
This works correctly, however now I would like to be able to access these added shapes and manipulate them.
(Attempt to) Loop through nth-child
for(i=0; i<this.shape.length; i++) {
$('#selected_shape_table:nth-child('+i+')').html("test");
}
HTML
<table id="selected_shape_table">
</table>
(Add shapes to table originally)
$('.shape').click(function() {
var typeOfShape = $(this).attr('id');
$('#selected_shape_table').append('<td><div id="' + typeOfShape + '" class=selected_shape"> + typeOfShape + '</div></td>');
});