Update task using JS