This is just a little helper function to add a 'click' event listener to a DOM element that will copy any defined text to the user's clipboard. It also allows for a callback function, presumably to present the user with some sort of indication that the text was actually copied to their clipboard.
A Pen by Adam Quinlan on CodePen.