1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Is there a way to make a button clickable after a certain amount of time?

Discussion in 'HTML & JavaScript' started by Inception_AC, Sep 17, 2015.

  1. Inception_AC

    Inception_AC Jr. Executive VIP Jr. VIP

    Joined:
    Feb 16, 2011
    Messages:
    1,964
    Likes Received:
    1,406
    Just wondering if this is possible??

    I want a Clickable button to appear after say 180 seconds, rather than have a html redirect after 180 seconds.

    Thanks
     
  2. Mission IMpossible

    Mission IMpossible Registered Member

    Joined:
    Jan 16, 2014
    Messages:
    61
    Likes Received:
    11
    Yeah it can be done through javascript
     
  3. M4XW3LL

    M4XW3LL Jr. VIP Jr. VIP

    Joined:
    Feb 5, 2013
    Messages:
    1,089
    Likes Received:
    1,273
  4. MrBlue

    MrBlue Senior Member

    Joined:
    Dec 18, 2009
    Messages:
    970
    Likes Received:
    678
    Occupation:
    Web/Bot Developer
    This can be easily achieved using jQuery and starting with a button element in a disabled state and simply changing it's state once the 180 seconds have expired.

    Here's an example:
    Code:
    
    <script>        
       setTimeout(function() {            
          $('#button-id').prop('disabled', false);        
       },180000);
    </script>  
    
    <button id="button-id" disabled="disabled">Click Me</button>
    
    
     
    Last edited: Sep 18, 2015