This is the html part for my problem
<DIV ID="CONTAINER">
<DIV CLASS="ITEMS">
Purchase
</DIV>
<DIV CLASS="ITEMS">
Return
</DIV>
<DIV CLASS="ITEMS">
On Hold
</DIV>
<DIV CLASS="ITEMS">
Exchange
</DIV>
</DIV>
Jquery
var MyArray = [];
var $Items = $('.ITEMS');
$Items.each(
function(){
Value = $.trim($(this).html());
MyArray.push(Value);
}
);
var Count_Parts = MyArray.length;
for (i = 1; i <= Count_Parts; i++ ){
console.log(MyArray[i]);
}
My Problem is that the console does not show correct results i see Return, On Hold, Exchange, undefined..... It is skipping Purchase and showing undefined instead? Why is Purchase being undefined?
for (i = 0; i < Count_Parts; i++ )Arrays are zero indexed...0, and the last element is at the index equal to the value of the array'slengthproperty minus1."