title: How to "Save" a particular picture inside a div that was replaced using a function?
body: <p>I got the codes from another answered question from this site. But what I want is that i want to make a button that saves the newly uploaded picture inside the div. As in if i refresh the page, the newly uploaded pic is there and not the old one.</p>
  
  <p>HTML:</p>
  
  <pre><code>   &lt;div id="profilepic"&gt;
          &lt;img src = "Anonymous.png" class = "profilepic" height="200px" width="200px"&gt;&lt;br/&gt;
      &lt;/div&gt;
      &lt;form id="changepic"&gt;
      &lt;br/&gt;&lt;input id="file" type="file" name="files[]" onchange="readURL(this)"&gt;&lt;br/&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>PHP:</p>
  
  <pre><code>    $(".imageSection button").click(function() {
          $(".imageSection img").removeClass("activeImage");
          $(this).parent().find("img").addClass("activeImage");
      });
      $(".imageSection:eq(0) img").addClass("activeImage");
  
      function readURL(input) {
          if (input.files &amp;&amp; input.files[0]) {
              var reader = new FileReader();
  
              reader.onload = function(e) {
                  $('.profilepic,.activeImage').attr('src', e.target.result).width(200).height(200);
  
                  $('.activeImage').css('display', 'inline');
              };
  
              reader.readAsDataURL(input.files[0]);
          }
      }
  </code></pre>
  
  <p>In this code, when i upload a picture image.jpg, it will replace the picture anonymous.png with image.jpg. Now what i want is, when the picture is changed, it will be permanent (like when i refresh the page, go to another page then go back again) unless i want to change it again. (it must be like a change profile picture feature in facebook,twitter, etc.)</p>