Display Image that is in an Array in Javascript -


i have series of arrays , output want display image. know how using document.write cant head around how using dom.

document.write("<p><img src='"+stones.value+"' alt='mick'></p>"); 

how achieve without using document.write?

 var img = new image();  img.src = stones.value;  img.alt = 'mick';   document.getelementbyid('targetelement').appendchild(img); 

i'm using image constructor here.

oriol shows how pure dom.

nice read: is there difference between `new image()` , `document.createelement('img')`?


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -