I am new to Javascript and I was trying to do something. I am using a function to load an image inside a table using innerHTML. But the image does not appear if I do not cause a warning ("all") at the bottom of the function, and then appears while the warning is displayed. The code I use is similar to (the function is called from an external js file)
<script> function show(){ document.getElementById('imageHolder1').innerHTML="<a href="#"><img='photos/picture.jpg' border=0/></a>"; } </script> <body> <input name="b1" type="button" value="pics" onclick="show()"/> <table><td id='imageHolder1'>picture</td></table> </body> ``
I donβt understand why this does not work, all the examples that I looked at are similar, I do not see big differences. Even if I try to disable the tag, it does not work. Well any help is appreciated! Thanks in advance, and if you have any suggestions on how to do this (without jquery, since I'm still learning javascript), I would also appreciate it. Thanks again!
source share