Is it possible in jquery or javascript to call a button click function. so for example in my JS:
$('#right').click(function(){
//My code
}
//call $('#right').click(function() function here
Is it possible to do this?
Directly from the documentation
Now if we click on this element, the alert is displayed:
Handler for
.click()called.We can also trigger the event when a different element is clicked:
$( "#other" ).click(function() { $( "#target" ).click(); });After this code executes, clicking on Trigger the handler will also alert the message.
Also in the definition of the function signatures, it also says the third one .click() is the same as .trigger("click").