I'm doing a preview, and it's happening like this, I want nothing to appear as if there is no image, and only the preview image appears when the user chooses the image.
It's getting so before putting the image, however I want it not to have this form without image:
Code:
JavaScript
varloadFile=function(event){varoutput=document.getElementById('output');output.src=URL.createObjectURL(event.target.files[0]);}
Htmlthattakestheimageandshows
<imgid="output" style="width:100%;height:250px;padding:10px 10px 10px 10px;"/>
<br>
<br>
<input type="file" name="img" id="img" accept="image/jpg, image/jpeg, image/png" onchange="loadFile(event)"/>
<br/><br/>