How to set value to input type file using jquery?
<p>i have button where i will browse images and in jquery i am trying to set that browsed images value to hidden input type file .I have tried so many example but i could not able to fix it.In php side i am getting null values.</p>

<p>HTML</p>

<pre><code>    &lt;button type="button" value="" id="activityAddOrEditfakeBrowse" onclick="invokeBrowseButtonClick('activityAddOrEditFile');" class="btn btn-primary btn-xs"&gt;&lt;i class="fa fa-upload"&gt;&lt;/i&gt;Upload Documents&lt;/button&gt;

 &lt;div id="section2"&gt;&lt;!-- for dynamic controls--&gt;
                              &lt;/div&gt;
</code></pre>

<p>JQUERY</p>

<pre><code>  var fileCnt = 0;

$('#activityAddOrEditFile').on('change', function(){ 

 var $input = $("&lt;input name='croppedDocumentActivity[]' type='file' id='croppedDocumentActivity"+ (fileCnt + 1) +"' value="+file.name+" class='croppedDocumentActivity'&gt;");
                        fileCnt++;
$('#section2').append($input);
</code></pre>