imgInp.onchange = evt => {
const [file] = imgInp.files
if (file) {
blah.src = URL.createObjectURL(file)
}
}
<form runat="server">
<input accept="image/*" type="file" id="imgInp" />
<img id="blah" src="#" alt="your image" />
</form>
More Related Contents:
- jQuery Ajax File Upload
- How to get full path of selected file on change of using javascript, jquery-ajax?
- How to use FormData for AJAX file upload?
- Upload multiple image using AJAX, PHP and jQuery
- How to check file input size with jQuery?
- Upload file with Ajax XMLHttpRequest
- Validation of file extension before uploading file
- Get file size before uploading
- Using HTML5 file uploads with AJAX and jQuery
- How to remove one specific selected file from input file control
- jQuery : simulating a click on a doesn’t work in Firefox? [duplicate]
- How to upload a file using jQuery.ajax and FormData
- Is it possible to check dimensions of image before uploading?
- How to have jQuery restrict file types on upload?
- Integrating Dropzone.js into existing HTML form with other fields
- Cancel event on input type=”file”
- Uploading multiple files asynchronously by blueimp jquery-fileupload
- copying the value of a form’s file input field to another form’s input field
- A file input button for all browsers, is this possible?
- Remove selected file(s) before upload with Javascript
- trigger file upload dialog using javascript/jquery
- How to add the background css into this jQuery? [duplicate]
- jQuery Set Cursor Position in Text Area
- Parse an URL in JavaScript
- get wrong value in data attribute jquery
- Dropdown select with images
- Generic way to detect if html form is edited
- How to create a simple map using JavaScript/JQuery [duplicate]
- Event capturing jQuery
- Is there an equivalent to e.PageX position for ‘touchstart’ event as there is for click event?