Add image element to DIV using JavaScript

Last Reply one year ago By chetan

Posted one year 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 one year ago.
Posted one year 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">