get token from input (js)