What am I doing wrong here?
This code works in all other browsers except IE.
I am attempting to auto-fill a form input using the code below.
parent.setTimeout('var input = document.querySelector("form.media-library__upload-url .form-text-input");' +
'var nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value").set; ' +
'nativeInputValueSetter.call(input, "http://lorempixel.com/400/200");' +
'var ev2 = new Event("input", { bubbles: true});' +
'input.dispatchEvent(ev2);', 0);
I have also tried using
setTimeout(function() {
var input = document.querySelector("form.media-library__upload-url .form-text-input");
var nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value").set;
nativeInputValueSetter.call(input, "http://lorempixel.com/400/200");
var ev2 = new Event("input", {
bubbles: true
});
input.dispatchEvent(ev2);
}, 0);
What is the proper way to do this in IE?
I am constantly getting this error
SCRIPT445: Object doesn't support this action