Why doesn't it display the image?

Discussion in 'JavaScript' started by x0x, Nov 20, 2010.

  1. #1
    <span onmouseover="document.getElementById('cinfo').firstChild.nodeValue = '<img src=\'http://farm3.static.flickr.com/2355/1527780565_a174884da4.jpg\'>';">



    <label id="cinfo">Image should be displayed here, but it just displays the code </label>



    It displays <img src='http://farm3.static.flickr.com/2355/1527780565_a174884da4.jpg'> not the image itself. Why is that? Would it be possible to make it show the image?
     
    x0x, Nov 20, 2010 IP
  2. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <span onmouseover="document.getElementById('cinfo').innerHTML = '<img src=\'http://farm3.static.flickr.com/2355/1527780565_a174884da4.jpg\'>';">
     
    Cash Nebula, Nov 21, 2010 IP
  3. x0x

    x0x Well-Known Member

    Messages:
    510
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    110
    #3
    thank you!
     
    x0x, Nov 24, 2010 IP