snippet to get clicked html element