modify index with javascript