I am working on a project in which I am using dragster library.I am trying to build a cards game . I stuck when I am trying to get values of card using dragster function.It runs loop twice which I dont want(first it runs 13 times then it run to what I want) .I want only that loop that runs last as it contain all elements which I need.First one run 13 times always.Its running like this:
0
1
.
.
upto 12
then it again run
0 to 11(this loop I want).
How can I ignore above loop. My code:
$('.test .block').find('div.Hearts').each(function(i,val){
let h = $(val).find('p#number').text();
console.log(h)
})
<p>elements with the sameid- which is invalid HTML for a start - also, there are 13 hearts in a deck of cards, just sayin'