Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js get paste text

function handlePaste (e) {
    var clipboardData, pastedData;

    // Stop data actually being pasted into div
    e.stopPropagation();
    e.preventDefault();

    // Get pasted data via clipboard API
    clipboardData = e.clipboardData || window.clipboardData;
    pastedData = clipboardData.getData('Text');
    
    // Do whatever with pasteddata
    alert(pastedData);
}

document.getElementById('editableDiv').addEventListener('paste', handlePaste);
Comment

PREVIOUS NEXT
Code Example
Javascript :: ejs view engine 
Javascript :: vue js footer copyright date automatically 
Javascript :: converting bytes into kb js 
Javascript :: Only numbers or string. Input field in React 
Javascript :: javascript change long digit ot k,m 
Javascript :: firebase database check if value exists 
Javascript :: slice until character javascript 
Javascript :: express get cookie 
Javascript :: pattern telefone js 
Javascript :: localstorage is not defined 
Javascript :: get current url in jsp page 
Javascript :: how to execute javascript after c# function execute 
Javascript :: copy an array without pointer in angular 
Javascript :: window.open javascript auto close 
Javascript :: html tag run only after whole page is loaded 
Javascript :: react image wont show 
Javascript :: Delete object in array with filter 
Javascript :: loop through object and get a certain values 
Javascript :: nombre random js 
Javascript :: convert string to array in vue js 
Javascript :: javascript array to comma separated list 
Javascript :: expo update react native 
Javascript :: js promise all return json array 
Javascript :: length of elements with display none 
Javascript :: node express post request json 
Javascript :: how replace 0 without replace 10 in js 
Javascript :: js tolocalestring with hours 
Javascript :: codewars js Find the first non-consecutive number 
Javascript :: javascript update url without reload 
Javascript :: set dropdown value using jquery 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =