add a dekegate event function and get parent dom functon.