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