I need to get all of the pasted string in input which has a maxLength attribute.
But in 'onpaste' event there is no property to get all of the pasted string.
For example, check below snippet with this string:
"AAAAA-BBBBB-BBBBB-BBBBB-BBBBB"
The output is : "AAAAA"
But I need all of the string.
const onPasteFn = (e) => {
setTimeout(() => document.getElementById("demo").innerHTML = e.target.value, 0)
}
<input type="text" maxLength="5" onpaste="onPasteFn(event)" />
<p id="demo"></p>