I think that you've forgotten to wrap this in an event listener. And don't forget the semicolon.