js: observe input event