how to access clipboard via js

JavaScript
navigator.clipboard.readText().then(clipText =>
  document.getElementById("outbox").innerText = clipText);
Source

Also in JavaScript: