switch text mode to javascript