I did some functions with onclick to replace a div (fill with an image), but how do I download the file with this change made? My idea is to make a Landing Page generator, after the changes I can download the file with the changes made PS: Code is not indented yet, was testing logic
<body>
    
<!-- Trigger the modal with a button -->
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Select Image</button>
<!-- Modal -->
<div id="myModal" class="modal fade" role="dialog">
  <div class="modal-dialog">
    <!-- Modal content-->
    <div class="modal-content">
      
      <div class="modal-body">
        <ul id="tipo">
            
            <li>
                <div class="seila">
                    <img  id="banner01" onclick="substituir01()" src="https://t3.ftcdn.net/jpg/05/23/38/92/360_F_523389242_J7wqy8fPTHseIDh2tALZEk3qQGhh6LKc.jpg" width="100px" height="100px">
                </div>
            </li>
            <li>
                <div class="seila">
                    <img  class="banner02" onclick="substituir02()"  src="https://gomake.com.br/wp-content/uploads/2019/06/logo_ads-900x450.jpg" width="100px" height="100px">
                </div>
            </li>
        </ul>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>
<div class="example">
    image select
    <div id="img-example">
    </div>
</div>
<script>
    this.$(".btnCustom").click(function() {
        var value = $(this).attr('id');
          $("#myModal #selection option[value="+value+"]").attr('selected', 'selected');
});
    function substituir01(){
        document.getElementById('img-example').innerHTML = "<img src=\"https://t3.ftcdn.net/jpg/05/23/38/92/360_F_523389242_J7wqy8fPTHseIDh2tALZEk3qQGhh6LKc.jpg\" width=\"500px\">";
    }
    function substituir02(){
        document.getElementById('img-example').innerHTML = "<img src=\"https://gomake.com.br/wp-content/uploads/2019/06/logo_ads-900x450.jpg\" width=\"500px\">";
    }
</script>
</body>
 
    