#1
  1. A Change of Season
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,536
    Rep Power
    221

    Copy To Clipboard


    Hi;

    I remember "Copy To Clipboard" used to be a difficult task. We needed flash etc.

    Now I found this little code and seems to be doing it super simple!

    Is this legit and reliable in your experience?

    Code:
    <script>
    function myFunction() {
      var copyText = document.getElementById("code_one");
      copyText.select();
      document.execCommand("Copy");
      alert("Copied the text: " + copyText.value);
    }
    </script>
    Code:
    <textarea id = "code_one" class="form-control" style="background-color: #fcfcde; font-size: 80%" rows="5"><script type="text/javascript" src="http://local.com/content.php" data-prospect_email="&lt;?php echo $_GET['email'];?&gt;" data-launch_owner_email_hashed="94bd214b329301de430bb6d" data-plc_id="2"></script></textarea>
  2. #2
  3. Impoverished Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,796
    Rep Power
    9646
    It's currently the most supported method available.

IMN logo majestic logo threadwatch logo seochat tools logo