Add event handling and JS initialization.