How to show image using <input> : <p>I want to be able to have my user input an image into the webpage.
As soon as they have imported the file from their computer the image should show in the img.</p>

<pre><code>&lt;body&gt;
    &lt;img id="myImage" height="200px" width="200px"&gt;
    &lt;input type="file" id="ImageInput" oninput="changeImage()"&gt;
    &lt;script&gt;
        function changeImage(){
            //def each element involved
            imageBox=document.getElementById("myImage");
            inputBox=document.getElementById("ImageInput");

            //set link from input box to image box link
            console.log(inputBox.files[0])
            imageBox.setAttribute("src",inputBox.files[0].name);
        }
    &lt;/script&gt;
&lt;/body&gt;
</code></pre>

<p>This code fails to find the image imported and so does nothing and pulls the error ERR_FILE_NOT_FOUND.</p>

<p>Currently i think its just trying to find the file locally and failing as it is not in the local directory but im unsure.</p>
