0

I want to do is if the user click to browse for files he should see images only no other files. How to do that using jquery?

My problem is I can see and choose other files besides images when i browse.

current output: http://jsfiddle.net/LvsYc/3123/

function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $('#Picture').attr('src', e.target.result); } reader.readAsDataURL(input.files[0]); } } $("#imgInp").change(function(){ readURL(this); }); 

1 Answer 1

2

Change your input to:

<input type='file' id="imgInp" accept="image/*" /> 

http://jsfiddle.net/LvsYc/3124/

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.