Add image element to DIV using JavaScript

Last Reply 11 months ago By chetan

Posted 11 months ago

Is it possible to call an image as a class and display it on page?


<div class="catimage"></div>


You are viewing reply posted by: chetan 11 months ago.
Posted 11 months ago

kindly refer the below.

<script type="text/javascript">
        var elem = document.createElement("img");
        elem.setAttribute("src", "");
        elem.setAttribute("height", "768");
        elem.setAttribute("width", "1024");
        elem.setAttribute("alt", "Flower");
<div id="placehere">