0

Below is my html code for image.

 <img src="" id="displaymirrorimage" height=auto width=auto style="display: none;">

Below is my javascript code for show image dynamically on mouseover.

document.getElementById("displaymirrorimage").style="display:block;";

It's working fine in Firefox and Chrome but can't work in Internet Explorer and Safari browser.

serge1peshcoff
  • 4,342
  • 11
  • 45
  • 76
sunil
  • 195
  • 1
  • 3
  • 11
  • Try `document.getElementById('displaymirrorimage').style.display = 'block';` – David R Sep 30 '16 at 12:21
  • Did you check this post ? http://stackoverflow.com/questions/1724342/onmouseover-doesnt-work-when-using-javascript-to-add-img-tag-on-ie – Alex Sep 30 '16 at 12:24
  • Make sure your `height=auto` and `width=auto` are not causing the issue. Pull those out and see what happens. In the older days, IE choked on this, but you did not specify a version of IE. – aardrian Sep 30 '16 at 18:28

1 Answers1

-1

Try: document.getElementById("displaymirrorimage").style.display="block";