add javascript to input mode