How to copy text or HTML to clipboard using JS/jQuery Today we learn how to copy texts and html into the clipboard by using js, we can copy content on button click or any event through JS. Here are the few simple methods for it. Please follow the below methods 1) Copy data-attribute value to clipboard If you have an html element like a button with data value and you want to copy value on button click then use below function HTML CODE <a class="cls_copy_pg_action copyAction copy-action-btn" data-value="THIS TEXT WILL BE COPIED" > <i class="far fa-copy"></i> Copy</a> JQUERY CODE $(document).on("click", ".copy-action-btn", function() { var trigger = $(this); $(".copy-action-btn").removeClass("text-success"); var $tempElement = $("<input>"); $("body").append($tempElement); ...
PHP,WORDPRESS,CAKEPHP,JQUERY,PHP TUTORIALS,CAKEPHP TUTORIALS,JQUERY CODES, CSS CODES, HTML CODES,EXPO, React, React Native, Angular,OOPS ,PHP INTERVIEW QUESTIONS @shubham715