Replaced obsolete href="javascript:code" in favor of event listeners