Assigning events to elements with same class name

You’ve learned me a lot with this. many many thanks!
this is very useful.