Click and edit in javascript