I have an input element with type="file", but I can not set the value to the element, I also want to fire the event change; this is the code:
let input_file=document.getElementsById('input');
input_file.setAttribute('value', "C:/images.jpg");
input_file.src= "C:/images.jpg";
let focus = new Event('focus', { bubbles: true });
input_file.dispatchEvent(focus);
let change = new Event('change', { bubbles: true });
input_file.dispatchEvent(change);
I also tried to set the value as:
input_file.value="C:/images.jpg";