I need to create a loop for msm to feed a graph.
while($(".previsto").eq(0).text(),){}
I need to get these values eq (0), eq (1), eq (2) ...
$(".previsto").eq(0).text(),
$(".previsto").eq(1).text(),
$(".previsto").eq(2).text(),
...
I need to create a loop for msm to feed a graph.
while($(".previsto").eq(0).text(),){}
I need to get these values eq (0), eq (1), eq (2) ...
$(".previsto").eq(0).text(),
$(".previsto").eq(1).text(),
$(".previsto").eq(2).text(),
...
To get indexes of elements (from first to last), the loop variable must begin in 0
to the number of elements -1:
for(var i = 0; i < $(".previsto").length; i++){
console.log($(".previsto").eq(i).text());
}
The $(".previsto").length
returns the number of elements with the class .previsto
, and the i
variable must start from 0
until it is less than $(".previsto").length
.