how to copy from js the lines of an html
function copyToClipboard(element) {
var $temp = $("<textarea>");
var brRegex = /<br\s*[\/]?>/gi;
$("body").append($temp);
$temp.val($(element).html().replace(brRegex, "\r\n")).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!");
});
Also in JavaScript:
- odoo submit form using js and display data
- moving letters animation javascript
- express messages
- best way to learn js
- sweetalert close on custom button click
- get user time using timezone javascript
- js log to console
- javascript glow
- javascript on click radio button get value
- how to make a button jump between two functions when clicked in javascript
- react generate ethereum address
- edit onclick event
- inheritance in javascript
- js script
- inline math mathjax
- javascript compose function
- js for in object
- Javascript format date / time
- read file javascript
- Error: There was an unhandled exception on the current circuit, so this circuit will be terminated. For more details turn on detailed exceptions by setting 'DetailedErrors: true' in 'appSettings.Development.json' or set 'CircuitOptions.DetailedErrors'.
- badlion client
- lexical scope javascript
- javascript function that make a choice
- How to copy text from a div to clipboard