I have a Function in java script it should print to a tag in HTML page. My code is:
function print(i) {
document.getElementById('print').innerHTML = line[i].toString();
};
The problem is my print() function is being called many times, so i am getting the output of the final value after the execution.