Username:   Password:  

Copy text to the clipboard

echo 'hello world' | pbcopy
cmd + v
 

Copies text to the clipboard

Tags

bash clipboard text copy

Get clipboard content with Javascript

<script language="JavaScript">
<!--
  contents = clipboardData.getData("Text");
  document.write(contents);
//-->
</script>

Gets the clipboard contents, if the clipboard contains text

Tags

JS Javascript clipboard