Add 'onClick' function to the Scripting API

[#44616231]