There is img. It is necessary that the user, when clicking on this picture, can select his own picture from his device. How to make when you click on the picture so that the proposal appears to choose the path to the new picture? need without jQuery

  • You have already asked four questions for which you received five answers. Note the checkmark icons to the left of the answers. They are intended for you - the author of questions. - Igor

1 answer 1

For example:

<input type="image" src="images/img.jpg" alt="Submit Image" /> 

Option:

 input { display: none; } 
 <label for="fileinput"> <img src="http://s1.iconbird.com/ico/2013/12/517/w128h1281386955323camera3.png" alt="Submit Image" > </label> <input name='fileinput' id="fileinput" type="file" accept="image/*" capture /> 

  • using this code will not change anything. I repeat, when you click on the picture, the user is asked to set the path to his photo on his device. This photo will be instead of the one that is originally. Tipo Avtar, as in VK. - Hundreds of Personalities
  • How do you want to show the picture to others without downloading it, if it is stored locally with the user? - velocat
  • Look, added option. Is this what you wanted? - velocat
  • Yes, it is close, but if I click on the picture, it offers me to choose the path to the new img, I choose the new img, but it is not installed in replacements of the previous one - Hundreds of Persons
  • How will you send the picture to the server? If you use Ajax, then in the reverse response from the server, you can send a link to the downloaded image and replace it with the existing one. You can of course and immediately replace, but what's the point? after reloading the page this image will just disappear. - velocat