+ Reply to Thread
Results 1 to 2 of 2

Thread: Javascript question

  1. #1
    arachide28 is offline x10Hosting Member arachide28 is an unknown quantity at this point
    Join Date
    Sep 2008
    Posts
    5

    Javascript question

    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?

  2. #2
    dickey's Avatar
    dickey is offline x10 Sophmore dickey is an unknown quantity at this point
    Join Date
    Sep 2008
    Location
    Singapore
    Posts
    128

    Re: Javascript question

    HTML Code:
    <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 by dickey; 09-24-2008 at 11:03 PM. Reason: Automerged Doublepost

+ Reply to Thread

Similar Threads

  1. javascript and external javascript files problem
    By delon in forum Programming Help
    Replies: 6
    Last Post: 04-27-2008, 12:41 AM
  2. A question about javascript files
    By rlodge in forum Programming Help
    Replies: 6
    Last Post: 12-19-2007, 11:26 AM
  3. Question regarding javascript
    By sarahangel in forum Free Hosting
    Replies: 2
    Last Post: 09-30-2007, 09:40 AM
  4. XML and Javascript
    By cuteboytm in forum Graphics & Webdesign
    Replies: 1
    Last Post: 09-21-2007, 10:00 AM
  5. question about some javascript code
    By dharmil in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 12-29-2006, 11:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers