Help with Javascript - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Help with Javascript

buttonmasherbuttonmasher United StatesPosts: 6Member

I have a page with Javascript that is supposed to move a graphic downward when I click a button. However, when I click the button, nothing happens. Can someone help me figure out what I'm doing wrong? Thanks.

Here's my code:

    <html>

    <head>
       <title></title>
       <script type="text/javascript">

          var column = 0;

          function moveArrowDown()
          {     

              document.getElementById("Darrow").style.top=335+(column*12);

              if (column < 20)
                 {
                     column++;
                     window.setTimeout("moveArrowDown();",130);
                 }

          }

       </script>
    </head>

    <body>

       <div align="center">
            <h1><strong>DHTML Down</strong></h1>

             <div id="Darrow" style="position:absolute; left:335px; top:240px; visibility:visible; z-index:2; width: 100px; height: 103px;"><img border="0" src="DArrowS.png" width="95" height="103"></div> 
       </div>

       <form>
           <input type="button" id="sbutton" value="submit" onClick="moveArrowDown();">
       </form>


    </body>
    </html>

Comments

  • buttonmasherbuttonmasher United StatesPosts: 6Member

    Never mind; I figured it out. There was some extra code in the <!DOCTYPE html> tag that I got rid of, and apparently, that code needed to be there.

Sign In or Register to comment.