Web Analytics Made Easy -
StatCounter TypeError: img1 is undefined - CodingForum

Announcement

Collapse
No announcement yet.

TypeError: img1 is undefined

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

  • TypeError: img1 is undefined

    Hi,

    code:

    var img1 = document.getElementsByTagName("img")[0];
    var img2 = document.getElementsByTagName("img")[1];
    img1.src = 'red.SVG';

    Why will this kind of an error message come: TypeError: img1 is undefined

    br,

    Seppo

  • #2
    there is no image in the document.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

    Comment

    Working...
    X