automatically focus desired input element according to the span element that has been clicked
refactored event handler names