Add a event handler in native javasceipt