some code review on tag selection js