Tuesday, September 20, 2016

Jquery copy to clipboard - ctrl + c event

Jquery copy to clipboard. How to copy a texbox or textarea content to clipboard using jquery. Here you will get exact result for this question. By using the below code, you can perform "ctrl + c" keyboard event automatically when a user hits a button. Lets see copy to clipboard jquery example
Jquery copy to clipboard - ctrl + c event
Jquery Control + C

Jquery copy to clipboard - ctrl + c code:


<input id="input_textbox" type="text" value="w3schools100" />
<button id="copy_but">Copy to clipboard</button>
 
<script>
    var input = document.getElementById("input_textbox");
 
    $("#copy_but").click(function(event){
        event.preventDefault();
        input.select();
        document.execCommand("copy");
    });
</script>

Search keywords: 
  • How to copy textbox contents using jquery
  • Jquery copy text to clipboard
  • Copy text box contents on a button click
  • How to trigger ctrl + c event  via code

No comments:

Post a Comment