Click a button without clicking

Discussion in 'JavaScript' started by baligena, May 4, 2011.

  1. #1
    Is their a way to click a button without clicking. For example using a bookmarklet

    <form>
    <input type="submit" onclick="window.open(website)">
    </form>

    is their I way to access input.

    PS.
    I already know 'document.forms[0].submit()'
    I want to access the input directly
     
    baligena, May 4, 2011 IP
  2. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #2
    How about this?
    
    <html>
    <head></head>
    <body>
    <button onclick="document.getElementById('submit').click();">Click</button>
    <input id="submit" type="submit" onclick="window.open()">
    </body>
    </html>
    
    Code (markup):
     
    Cash Nebula, May 4, 2011 IP