[#169]Adjust the code using javascript 
event delegation to improve the performance.