Home > Net >  jQuery form submit and html tag
jQuery form submit and html tag

Time:11-06

In my code, I am showing an image to the user by changing the src to


 $("#"   img_tag_id).attr('src', image.toDataURL());

how can I take the value of this file to input tag below:

HTML code:

   <input type="file" name="uploadNewImage">

I am using finecrop plugin

CodePudding user response:

Something like $('input[name='uploadNewImage']').attr('src', image.toDataURL());

CodePudding user response:

You should get the src attribute of the input element, since it should contain the URL that it displays:

$('input[name='uploadNewImage']').attr('src', image.toDataURL());

  • Related