Suppose I have a long string:
"Jackie has a very big chicken at his farm"
And I highlight "chicken" from the string and hit ctrl+C,
It will trigger the handleCopy
function passed into onCopy
attribute of the element. I want to have the value of the substring or string being copied, in this case, "chicken" For example,
function handleCopy(event){
//get the copied value here
}
<input value="Jackie has a very big chicken at his farm" onCopy={handleCopy} />
How am I able to achieve this in React?
Via Active questions tagged javascript - Stack Overflow https://ift.tt/iRDZqtF
Comments
Post a Comment