<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Copy to clipboard using jquery example - techsolutionstuff.cpm</title>
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
alert("Success");
$("textarea").select();
document.execCommand('copy');
});
});
</script>
</head>
<body>
<h3>Copy To Clipboard JQuery Example - techsolutionstuff.com</h3>
<textarea id="comment" rows="5" cols="62"></textarea>
<p><button type="button">Copy To Clipboard</button></p>
<p><strong>Note:</strong> Type something in the textarea and click the button to see the output.</p>
</body>
</html>