Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to copy from js the lines of an html

function copyToClipboard(element) {
  var $temp = $("<textarea>");
  var brRegex = /<brs*[/]?>/gi;
  $("body").append($temp);
  $temp.val($(element).html().replace(brRegex, "
")).select();
  document.execCommand("copy");
  $temp.remove();
}

$( "#FailCopy" ).click(function() {
  alert("Well done! div #error-details has been copy to your clipboard, now paste it in the notepad or email!");
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: activejs 
Javascript :: warning Non-interactive elements should not be assigned mouse or keyboard event listeners jsx-a11y/no-noninteractive-element-interactions 
Javascript :: java jsf rendered 
Javascript :: select coordinates of image 
Javascript :: javascript substring messes emoji 
Javascript :: react-native-quick-scroll npm 
Javascript :: what is the purpose of subscript in an array 
Javascript :: if property is same group javscript 
Javascript :: mongoose reference another model 
Javascript :: disable save image option 
Javascript :: adding growl delete notifications in vanilla js 
Javascript :: ajouter un lien href dans du javascript 
Javascript :: jquery post docs.google.com/forms/ CORS 
Javascript :: javascript repace enter event with another character 
Javascript :: populate DataTable from django json 
Javascript :: java code that writes code in powerpoint 
Javascript :: concept of node js with react js 
Javascript :: how to display data from json api using flutter expansiontile 
Javascript :: javascript stringify line breaks 
Javascript :: rdlc refresh dataset from object 
Javascript :: fabric js background pathern 
Javascript :: chrome back button click event react 
Javascript :: diynamic time vue js 
Javascript :: why setjavascriptenabled will true 
Javascript :: how can we give the index of an array as an ID to an element 
Javascript :: how to autoclose paranthesis in javascript input 
Javascript :: enviar datos de un formulario por correo electronico 
Javascript :: elte html if not updating 
Javascript :: how to edit local json files using node 
Javascript :: modulo operator multiples, alternate values 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =