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 ::  
:: password textInput not working on android 
:: how to add json datasource in jasperserver 
Javascript :: most common use cases of portals in react 
Javascript :: winston exclude routes 
Javascript :: variable is not null if used optstring json object 
Javascript :: react hooks simple projects 
Javascript :: 5.625/2 
Javascript :: javascript inicializar una variable 
Javascript :: npm react router 6.0.0-alpha.2 
Javascript :: pupetter create incognitor browser 
::  
Javascript :: querySelector a slot vuejs 
:: javascript lookahead 
Javascript :: get switchery to load after an ajax call 
Javascript :: click and copy jquery dynamic content 
Javascript :: npm smart contract sjon schema 
Javascript :: transaction mode javascript 
Javascript :: return component from react hook 
Javascript :: jlkj 
Javascript ::  
:: fetch an webpage and parse js 
::  
::  
ADD CONTENT
Topic
Content
Source link
Name
4+4 =