Web Analytics Made Easy -
StatCounter Help to load an image whose source is a variable. - CodingForum

Announcement

Collapse
No announcement yet.

Help to load an image whose source is a variable.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help to load an image whose source is a variable.

    for example, in this code, what should I do to make it work?

    mysource = myarray[i] + ".gif"

    <input type="image" border=0 name="bookimage" src=mysource>

  • #2
    <script language="javascript">
    document.write('<input type="image" border=0 name="bookimage" src="'+mysource+'">')
    </script>

    Comment


    • #3
      or if you want to change the src after the page has loaded or some events like onmouseover.

      document.images['bookimage'].src = myarray[i] + ".gif";
      Glenn
      vBulletin Mods That Rock!

      Comment

      Working...
      X