Javascript question

arachide28

New Member
Messages
5
Reaction score
0
Points
0
Yeah, well, Javascript isn't one of my strong points, hell it isn't even one of my points. So anyway, basically I want a javascript where a user clicks on a button and it makes an image appear, kind of like a slideshow I guess. So, I want a user to click just a simple input button, and an image appears in a div underneath the button. Any help please?
 

dickey

New Member
Messages
128
Reaction score
0
Points
0
HTML:
<script type='text/javascript'>
  function picture_appear()
    new_image = document.createElement("img");
    new_image_src = document.createAttribute("src");
    new_image.setAttribute(new_image_src,"image_name.jpg");
    where = document.getElementById('here');
    where.appendChild(new_image);
  }
</script>  


...
<body>
  <input type='button' onclick='picture_appear()'>
  <div id='here'>
  </div>
...
</body>
</html>
Edit:
Try that and see if it works. Basically that is the idea.
 
Last edited:
Top