• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1209
  • Last Modified:

Fire click event within function

How can i fire a click event within a javascript function? I do have the YUI library available to me.

myfunction(){
    document.getElementById("testbutton").onclick();
}

something like that... does yui have a solution that is browser neutral?

0
Andrew Maurer
Asked:
Andrew Maurer
  • 4
1 Solution
 
fermieCommented:
please try this
document.getElementById("testbutton").click();

Open in new window

0
 
Andrew MaurerAuthor Commented:
document.getElementById("bttnSubmitSearchBySize").click is not a function
[Break on this error] document.getElementById("bttnSubmitSearchBySize").click();
0
 
Andrew MaurerAuthor Commented:
thats in FireFox
0
 
Andrew MaurerAuthor Commented:
it does work in IE... but not FF
0
 
Andrew MaurerAuthor Commented:
I want this solution in the EE database so I will accept the answer, but it is incomplete. Seems that click() method does not exist in FF and therefore.. should be avoided because it is browser specific. I have looked high and low for an answer and what I've come up with is, you cant use click() in FF.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now