how to write onclick function for button in jquery code example Example: jquery onclick function $( "#other" ).click(function() { $( "#target" ).click(); });