adding event handlers to test.html script