Skip to content Skip to sidebar Skip to footer

Appending Javascript Array Values To The Dojo Div

I have a Array of Values as shown above . myarray2.push('10-FEB-11'); myarray2.push('11-FEB-11'); myarray2.push('12-FEB-11'); myarray2.push('13-FEB-11'); myarray2.push('14-FEB-11')

Solution 1:

You can accomplish this with a simple javascript for loop:

var ol = document.getElementById('hrXAxisSlider')
                 .getElementsByTagName('ol')[0],
    ma2l = myarray2.length,
    i, 
    htmlFrag = '';

for (i = 0; i < ma2l; i++) {
    htmlFrag += '<li>' + myarray2[i] + '</li>';
}

ol.innerHTML = htmlFrag;

See example →

Post a Comment for "Appending Javascript Array Values To The Dojo Div"