Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js get img under div

function getImages(contentId) {
    var content = document.getElementById(contentId);
    // only one image, just return an item; or you can return an array
    if (content) return document.getElementsByTagName('img')[0];
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #img #div
ADD COMMENT
Topic
Name
5+8 =