Hello,
Please find the code below
<script type="text/javascript">
$(function(){
var c=1;
$("#i1").toggle(function(){
$("#e1").appendTo("#i2");
$('#counter').attr('value',c);
},
function(){
$("#e1").appendTo($(this));
$('#counter').attr('value',c);
});
c++;
});
</script>
<div id=i1><span id="e1">Item 1</span></div>
<div id=i2><span id="e2">Item 2</span></div>
<input type=text value='' id=counter>
When the counter is placed, it does increment and decrement, but the value goes up by +2 each time I click on add, and -1 on remove.
What exactly is wrong
Thanks Jean