Why does my image not show up when I use Javascript innerHTML to call it?

前端 未结 4 749
旧巷少年郎
旧巷少年郎 2021-01-18 13:00

I am pretty new to Javascript, and I was trying somethings out. I am using a function to load an image inside a table using innerHTML. But the image does not show up, unless

4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-18 13:49

    You have an error in your string:

    document.getElementById('imageHolder1').innerHTML="";
    

    Should read

    document.getElementById('imageHolder1').innerHTML="";
    

    (notice " to ' replacement)

提交回复
热议问题