Reply
Thu 13 Feb, 2014 02:00 pm
i need to write given html lines every time .(in bottom)
so i make a js program and stored image in array everything is working fine except that variable "which" value is not changing its remains constant at 10.how to overcome this.i dont want to like function(i). i want to write value of "which" equal to i.
javascript:
for(var i=0;i<10;i++)
{
html=html+"<a href='#'onclick='myfunc();which=i;click++;return false;'><img src='"+photos+"'/></a>";
}
html:
<a href="#"onclick="which=1;myfunc();return false;click++"><img src="files/924325/mk0.jpg"></a>
<a href="#"onclick="which=2;myfunc();return false;click++"><img src="files/924325/mk1.jpg"></a>