I have number of child divs inside a parent div and each div has a label, markup looks something like this.
<div id="Parent">
<div id="Child1" onclick="DeleteDiv('#Child1')">
<label> 1<label>
</div>
<div id="Child2" onclick="DeleteDiv('#Child2')">
<label>2<label>
</div>
<div id="Child3" onclick="DeleteDiv('#Child3')">
<label>3<label>
</div>
<div id="Chile4" onclick="DeleteDiv('#Child4')">
<label>4<label>
</div>
</div>
each child div has delete option and script that deletes the div is
function DeleteDiv(divtodelete) {
$(divtodelete).remove();
}
Now let's say I delete Child1 I want rest of the label to be updated with the value 1,2,3 instead of remaining as 2,3,4.
another scenario would be if I delete child2 labels should be updated with value 1,2,3 respectively instead of remaining as 1,3,4.
How do I do this?