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