display image using javascript - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Image


display image using javascript

Demo Code

ResultView the demo in separate window

      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
function imag(c,x) {//from ww  w  .  ja  v  a  2s.com
  var arr = [];
  for (var i = 0; i < x; i++) {
  document.getElementById("demo").innerHTML = arr;

      <p>Click the button to add a new element to the array.</p> 
      <input type="number" id="myNumber" value=""> 
      <button onclick="imag('hello',5)">Try it</button> 
      <p id="demo"></p>  

Related Tutorials