Possible Duplicate:
Fake “click” to activate an onclick method
I want to simulate false click when a user click on other div. Is this possible?
Possible Duplicate:
Fake “click” to activate an onclick method
I want to simulate false click when a user click on other div. Is this possible?
If by "fake click" you mean to invoke the onclick
event handler for a DOM object programmatically, then do it like this:
$("#myDiv").click( function() {
$("someOtherElement").click();
} );
The first line assigns a new onclick event handler to <div id="myDiv">
. When that element is clicked it will make the <div id="someOtherElement">
behave as though it, too, was clicked by the user.