event
is undefined in firefox, because firefox doesn't have this property and instead you can provides an event to an event handler function as a parameter.
However your code is fine to work in Chrome and IE
Further I would also have script a type like
and not just