Added JS code to handle initialize and sending click input.