<script language="javascript"> 
var counter=0; 
var i=1;
function saveclick() 
{ 
<%j++;%>
    if(counter==3)
    { 
alert(counter);
}
else {
document.getElementById("error").innerHTML ="<%=qarr[j]%>"
  }
}
</script>
here i am using a qarr an array of String and its return String of corresponding index of array. But when i click on button this javascripts' saveclick function execute but innerhtml shows only one String all times. I want that when i click on button then js function execute and every time new String appear in innerHtml. please do needful in this matter.
 
     
     
    