Code Snippets 4 U
function copyElementText() {
    var elm = document.getElementById("text");
    // for Internet Explorer

    if (document.body.createTextRange) {
        var range = document.body.createTextRange();
        range.moveToElementText(elm);
        range.select();
        document.execCommand("Copy");
        $("#copybtn").html("Copied");
        setInterval(function () {

          popup.classList.add('hide');

        }, 500);
    } else if (window.getSelection) {
        // other browsers

        var selection = window.getSelection();
        var range = document.createRange();
        range.selectNodeContents(elm);
        selection.removeAllRanges();
        selection.addRange(range);
        document.execCommand("Copy");
        $("#copybtn").html("Copied");
        setInterval(function () {

           popup.classList.add('hide');

        }, 500);

    }
}

Leave a Reply

Your email address will not be published. Required fields are marked *

eighty six − = eighty