improve input javascript