Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<div class="target" contenteditable="true">Paste your rtf from excel/somewhere else here and get the source of it (the console shows all available types).</div>
<script>
const target = document.querySelector('div.target');
target.addEventListener('paste', (event) => {
    console.log(event.clipboardData);
    console.log(event.clipboardData.types);
    let paste = (event.clipboardData || window.clipboardData).getData('text/rtf');
    console.log(paste);
    const selection = window.getSelection();
    if (!selection.rangeCount) return false;
    selection.deleteFromDocument();
    selection.getRangeAt(0).insertNode(document.createTextNode(paste));
    event.preventDefault();
});
</script>
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
rokondopro
0viewers