Reputation: 2685
I have array[1,2,3,4,5,6]
. Onclick select button I'm able to increment array. But on click remove button, I want to reset array e.g. [1,2,3,4] if I remove number 2 array then order should become [1,2,3]. Basically, re-order in increment order.
var spl = $('.cc').text();
var tc = spl.split("").sort();
var l = 0;
var p = [];
l = l % tc.length;
$('.cc').text(tc[l]);
Upvotes: 2
Views: 477