added DOM event changes to javascript