Can I use onpaste event in my plugin?

Here is part of my plugin code, I have a textarea to paste svg code, and I want to modify it before pasting

    let input_field = document.createElement("textarea")
    input_field.setAttribute("id", "svgcode"); = 400 = 400
    input_field.onpaste = async (e) => {
        // lamclipboard = e.clipboardData.getData('Text')
        // modify lamclipboard


The onpaste here is not working.

Why document onclick event can work well in similar function?

Not all web events are supported – paste is one of them.

If you want to change the content, you’ll need to do so with input or change.