Move javascript calls to button tag

because otherwise it didn’t work in Firefox