Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to print a list in javascript

var array = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
for (var i = 0; i < array.length; i++) {
  var str = '';
  for (var j = 0; j <= i; j++) {
    if (array[j] == 'E') str += '3';
    else str += array[j];
  }
  document.querySelector('span').innerHTML = document.querySelector('span').innerHTML + str + '<br />';
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #print #list #javascript
ADD COMMENT
Topic
Name
2+6 =