www.webdeveloper.com
Results 1 to 3 of 3

Thread: please help a newbie

  1. #1
    Join Date
    Mar 2010
    Posts
    2

    please help a newbie

    i have a complex script im working on but cant get it to work so i cut it right down to basics and still cant get it to work

    Code:
    <head>
    <script type="text/javascript">
    
    function showdist(){
    	
    var numx = 1;
    var numy = 2;
    	
    document.getElementById(myx2).value = numx;
    document.getElementById(myy2).value = numy;
    
    }
    </script>
    </head>
    
    <body>
    <img src=./images/1.jpg onmouseover="showdist();"><br><br>
    
    myx <input type="text" size="35" id="myx2" value="0" /> <br>
    myy <input type="text" size="35" id="myy2" value="0" /> <br>
    
    </body>
    whats wrong? it just doesnt do anything, nothing at all. any help would be MUCH appreciated

    p.s. sorry for joining just to ask for help, but i have reached my limit with this.

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    ID is a string
    Code:
    document.getElementById("myx2").value = numx;
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Mar 2010
    Posts
    2
    Quote Originally Posted by Fang View Post
    ID is a string
    Code:
    document.getElementById("myx2").value = numx;
    omg, LOL, well im pretty embarrased now, i know im new to javascript but i thought i could have found that one.

    thank-you for solution works good now

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles