Note that there are some explanatory texts on larger screens.

plurals
  1. POmultiple image upload and preview
    text
    copied!<p>I am learning how to upload multiple images and showing their preview...</p> <p>I came across the following code</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;style&gt; .input-file-row-1:after { content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0; } .input-file-row-1{ display: inline-block; margin-top: 25px; position: relative; } #preview_image { display: none; width: 90px; height: 90px; margin: 2px 0px 0px 5px; border-radius: 10px; } .upload-file-container { position: relative; width: 100px; height: 137px; overflow: hidden; background: url('images/picplus.png') top center no-repeat; float: left; margin-left: 23px; } .upload-file-container-text{ font-family: Arial, sans-serif; font-size: 12px; color: #719d2b; line-height: 17px; text-align: center; display: block; position: absolute; left: 0; bottom: 0; width: 100px; height: 35px; } .upload-file-container-text &gt; span{ border-bottom: 1px solid #719d2b; cursor: pointer; } .one_opacity_0 { opacity: 0; height: 0; width: 1px; float: left; } &lt;/style&gt; &lt;script&gt; function readURL(input,target) { if(input.files &amp;&amp; input.files[0]) { var reader=new FileReader(); var image_target=$(target); reader.onload=function(e) { image_target.attr('src',e.target.result).show(); }; reader.readAsDataUrl(input.files[0]); } } $("patient_pic").live("change",function(){ readURL(this,"#preview_image") }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form name="" method="post" action="#" class="feedback-form-1"&gt; &lt;fieldset&gt; &lt;div class="input-file-row-1"&gt; &lt;div class="upload-file-container"&gt; &lt;img id="preview_image" src="#" alt="" /&gt; &lt;div class="upload-file-container-text"&gt; &lt;div class = 'one_opacity_0'&gt; &lt;input type="file" id="patient_pic" label = "add" /&gt; &lt;/div&gt; &lt;span&gt; Add Photo &lt;/span&gt; &lt;/div&gt; &lt;div class="upload-file-container-text"&gt; &lt;div class = 'one_opacity_0'&gt; &lt;input type="file" id="patient_pic" label = "add" /&gt; &lt;/div&gt; &lt;span&gt; Add Photo &lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/fieldset&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I came across this <a href="http://jsfiddle.net/dn9Sr/2/" rel="nofollow noreferrer">http://jsfiddle.net/dn9Sr/2/</a> (fiddle) which explains it perfectly to me. But being a beginner I know it includes a jquery library which clearly shows in framework extension of Fiddle. now my issue is. How exactly should I include it when I start the coding on my machine.</p> <p>what will be included in the head() section to make a call to the library... thank you</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload