Hi guys, I am trying to understand what this line of code actually does in line 3?
var file = document.querySelector(‘input[type=file]’).files[0];
And here is the script file (JS):
function update_image(){//insert image
var img = document.querySelector(‘img’);
var file = document.querySelector(‘input[type=file]’).files[0];
img.src = window.URL.createObjectURL(file);