Simple Javascript help needed

Discussion in 'JavaScript' started by ReaL DiGiTaL GiRL, Dec 23, 2014.

  1. #1
    Hi All
    I Need A Simple Help With Javascript
    There is a javascript button on my site
    I Want That When My Site Loads after 3 seconds it will get clicked automatically ,,,


    I Have Tried But Unable To Create Exact Code
     
    Solved! View solution.
    ReaL DiGiTaL GiRL, Dec 23, 2014 IP
  2. #2
    Glad to help! Asuming you're using jquery:

    
    setTimeout(function() {
      $('#your-button-id').click();
    }, 3000);
    
    Code (JavaScript):
    The 3000 at the end is the number of miliseconds. 5 seconds would be 5000.
     
    Pigeon Yoga, Jan 4, 2015 IP