Copy text from input to clipboard

PHOTO EMBED

Fri Mar 18 2022 03:54:33 GMT+0000 (UTC)

Saved by @zildjianjaxolis #javascript #jquery

$( document ).on( 'click', '.copy_registry_link', function(e) {
    e.preventDefault();
    this.select();
    this.setSelectionRange(0, 99999); /* For mobile devices */

    /* Copy the text inside the text field */
    navigator.clipboard.writeText(this.value);
    alert("Gift Registry link copied.");
} );
content_copyCOPY