Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js paste event

const target = document.querySelector('div.target');

target.addEventListener('paste', (event) => {
    let paste = (event.clipboardData || window.clipboardData).getData('text');
    paste = paste.toUpperCase();
 
    const selection = window.getSelection();
    if (!selection.rangeCount) return false;
    selection.deleteFromDocument();
    selection.getRangeAt(0).insertNode(document.createTextNode(paste));

    event.preventDefault();
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: console regex 
Javascript :: angular date formats 
Javascript :: javascript sort alphabetically 
Javascript :: remove all spaces javascript 
Javascript :: create random aleatory token javascript 
Javascript :: javasscript get the content inbetween a select tag 
Javascript :: apache angular routing 
Javascript :: document load complete jquery 
Javascript :: react-native-youtube-iframe android crash 
Javascript :: javascript click to copy 
Javascript :: add suffix to sequelize records while updting 
Javascript :: angular run validation on other controls 
Javascript :: nodejs error _.isNull is not a function 
Javascript :: get all iinputs of type button 
Javascript :: set value of radio button jquery 
Javascript :: flexbox stretch height 
Javascript :: linebreak-style 
Javascript :: js round up decimal 
Javascript :: autoplay video in angular 
Javascript :: select only jpg jpeg images 
Javascript :: external button to fire dropzone.js 
Javascript :: Iterate with JavaScript While Loops 
Javascript :: jquery get selected checkboxes 
Javascript :: get specific item from local storage 
Javascript :: postman scripts check variable exists 
Javascript :: on member join discord js 
Javascript :: javascript get boundary client rect 
Javascript :: button disabled angular 
Javascript :: javascript absolute value 
Javascript :: capture enter button react input 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =