function registerOnCopy(el) {
        el.addEventListener(
            "copy",
            function oncopy(e) {
                e.preventDefault();
                var sel = w.getSelection();
                var docFrag = sel.getRangeAt(0).cloneContents();
                var div = document.createElement("div");
                div.appendChild(docFrag);
                var selectedHTML = div.innerHTML;
                var selectedText = sel.toString();
                /* eslint-disable security/detect-non-literal-regexp */
                e.clipboardData.setData("text/plain", selectedText.replace(new RegExp(SOFTHYPHEN, "g"), ""));
                e.clipboardData.setData("text/html", selectedHTML.replace(new RegExp(SOFTHYPHEN, "g"), ""));
                /* eslint-enable security/detect-non-literal-regexp */
            },
            true
        );
    }
Register copy event on element
@param {Object} el The element
@returns {undefined}