Tuesday, December 31, 2019

Copy HTML into the clipboard from the DOM with JavaScript.

var textArea = document.createElement("textarea");
textArea.value = document.getElementById("touchMe").innerHTML;
textArea.style.position = "fixed";
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
document.execCommand('copy');
document.body.removeChild(textArea);

 
 

Honestly, something like this might be a little bit better:

if (!copying) {
   copying = true;
   var textArea = document.createElement("textarea");
   textArea.value = document.getElementById("touchMe").innerHTML;
   textArea.style.position = "fixed";
   document.body.appendChild(textArea);
   textArea.focus();
   textArea.select();
   document.execCommand('copy');
   var cleanUp = function() {
   try {
      document.body.removeChild(textArea);
   } catch (error) {
      
   }    clearInterval(interval);
   copying = false;
   };
   var interval = setInterval(cleanUp, 6000);
}

A switch is designed to connect computers within your LAN.

A router gives you your internet connection.

Ctrl-P

...tends to kick off printing things in Windowsland.

SentryOne Plan Explorer

This helps you see the execution plan for a blob of T-SQL and tune it.

Apache Directory Studio

It will allow you to browse Active Directory records.

ApexSQL

It is a set of SQL Server DBA tools.

pivot table

It's a snapshot, a high-level summary of a more detailed table.