Categories
Programming Web

jQuery: copy events from one element to another

At the moment, I improve my ApToggleSwitch plugin and stumbled over a problem which leads to a nice jQuery function I want to share. Perhaps this code can be useful for you!

The problem was that I have to copy a special event from one html element to another – in my case I only wanted the change event to be copied. I found some posts how to copy events, but the solutions did not work perfectly, so I had to merge the solutions presented in this thread.