self clicking button jquery code example Example 1: trigger button click jquery $("input").trigger("click"); Example 2: set onclick jquery $(elem).click(myFunc());