Wednesday, 5 June 2019

Copy Current url to clipboard using Javascript


function copyLinkWhatsup()
    {

        var dummy = document.createElement('input'),
          text = window.location.href;
        document.body.appendCh
ild(dummy);
        dummy.value = text;
        dummy.select();
        document.execCommand('copy');
        document.body.removeChild(dummy);
        alert('Link copied please open whatsup and paste to send');
    }


No comments:

Post a Comment