0
   

How to write every time new value of variable "which" in my html

 
 
paretag
 
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>

  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 565 • Replies: 0
No top replies

 
 

Related Topics

 
  1. Forums
  2. » How to write every time new value of variable "which" in my html
Copyright © 2025 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 02/10/2025 at 09:56:41