Advanced Search

Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Button not working

  1. #11
    Join Date
    May 2013
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    have a look on screenshot .. I don't why it is not working for you


  2. #12
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    672
    Thanks
    1
    Thanked 110 Times in 108 Posts

    Default

    Hi there jelly46,

    Try it like this...
    Code:
    
    <!DOCTYPE html>
    <html lang="en">
    <head>
    
    <meta charset="utf-8">
    
    <title>untitled document</title>
    
    <style>
    .hide {
       display:none;
     }
    </style>
    
    <script>
    (function() {
       'use strict';
    
    function init(){
    
       var myurl='http://www.google.com';
    
    document.getElementById('nxt').className='';
    document.getElementById('nxt').onclick=function() {
       location.href=myurl;
      }
     }
       window.addEventListener?
       window.addEventListener('load',init,false):
       window.attachEvent('onload',init);
    })();
    </script>
    
    </head>
    <body>
    
    <button id="nxt" class="hide">Next</button>
    
    </body>
    </html>
    coothead
    Last edited by coothead; 07-05-2013 at 04:53 PM.

  3. #13
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    672
    Thanks
    1
    Thanked 110 Times in 108 Posts

    Default

    Hi there jelly46,

    by the way, your code...
    Code:
    
    <button onclick="window.location.href='http://www.google.com'">Next</button>
    ...does work.

    coothead

Similar Threads

  1. Menu Bar Button Links Aren't Working
    By onestopplay in forum CSS
    Replies: 0
    Last Post: 06-19-2011, 01:34 AM
  2. Javascript not working for liquid css button
    By arc_85 in forum JavaScript
    Replies: 1
    Last Post: 10-20-2010, 10:59 AM
  3. Replies: 0
    Last Post: 10-20-2010, 10:02 AM
  4. Replies: 9
    Last Post: 08-09-2009, 04:58 PM
  5. a working register and a login button required
    By souravsaha86 in forum HTML
    Replies: 7
    Last Post: 03-30-2006, 04:55 AM

Bookmarks

Posting Permissions

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