How to check if the insert supports browser support?

I have the following code to check if support for browser insertion is supported, returns true in firefox, but event insertion does not fire.

var is_paste_supported = (function() {
    var el = document.createElement('div');
    el.setAttribute('onpaste', 'return;');
    return typeof el.onpaste == "function";
})();

Is there a better test to embed besides snif browser?

+4
source share

Source: https://habr.com/ru/post/1622600/


All Articles