title: Div does not refresh after opinion insert to array
body: <p>i insert some values to my array (array and output is viewed in console after insert) but html content does not refresh (I must press F5 and then content comes out).
  Thank you for help (I am using jquery/js).</p>
  <pre><code>
  if(localStorage.myTreesComments){
     opinions=JSON.parse(localStorage.myTreesComments);
  }
  
  console.log(opinions);
  
  
  const myFrmElm=document.getElementById(&quot;opnFrm&quot;);
  
  myFrmElm.addEventListener
  (&quot;submit&quot;,processOpnFrmData);
  
  /**
  * initialisation of the list of visitor opinions and form submit setup
  */
  function init(){
     if (localStorage.myTreesComments) {
         this.opinions = JSON.parse(localStorage.myTreesComments);
     }
  
     this.opinionsElm.innerHTML = this.opinionArray2html(this.opinions);
  
  
     this.opinionsFrmElm.addEventListener(&quot;submit&quot;, event =&gt; this.processOpnFrmData(event));
  }
  
  function processOpnFrmData(event) {
     //1.prevent normal event (form sending) processing
     event.preventDefault();
  
     //2. Read and adjust data from the form (here we remove white spaces before and after the strings)
     const nopName = document.getElementById(&quot;menoapriezvisko&quot;).value.trim();
     const nopEmail = document.getElementById(&quot;email&quot;).value.trim();
     const nopUrl = document.getElementById(&quot;url&quot;).value.trim();
     const nopComm = document.getElementById(&quot;komentar&quot;).value.trim();
     const nopSlovo = document.getElementById(&quot;klucoveslovo&quot;).value.trim();
  
  
     const nopWillReturn = document.getElementById(&quot;willReturnElm&quot;).checked;
  
  
  
     //3. Verify the data
     if(nopName==&quot;&quot; || nopEmail==&quot;&quot;|| nopUrl==&quot;&quot;|| nopComm==&quot;&quot;|| nopSlovo==&quot;&quot;){
         window.alert(&quot;Prosím, zadajte všetky údaje.&quot;);
         return;
     }
  
  
     //3. Add the data to the array opinions and local storage
     const newOpinion =
         {
             name: nopName,
             email: nopEmail,
             url: nopUrl,
             comment: nopComm,
             gdpr: nopWillReturn,
             klucove_slovo: nopSlovo,
             created: new Date()
         };
  
     console.log(&quot;Nový názor návštevníka:\n &quot;+JSON.stringify(newOpinion));
  
     opinions.push(newOpinion);
  
     localStorage.myTreesComments = JSON.stringify(opinions);
  
  
     //4. Notify the user
     window.alert(&quot;Tvoj názor bol uložený a pridaný na stránku!&quot;);
     console.log(&quot;Nový názor bol pridaný!&quot;);
     console.log(opinions);
  
     //4. Update HTML
     this.opinionsElm.innerHTML+=this.opinion2html(newOpinion);
  
     //5. Reset the form
     myFrmElm.reset(); //resets the form
     /*this.opinionsFrmElm.reset(); //resets the form*/
  
  }
  /**
  * creates html code for one opinion using a template literal
  * @param opinion - object with the opinion
  * @returns {string} - html code with the opinion
  */
  
  function opinion2html(opinion){
     const opinionTemplate=
         `
             &lt;section&gt;
                &lt;h3&gt;${opinion.name} &lt;i&gt;(${(new Date(opinion.created)).toDateString()})&lt;/i&gt;&lt;/h3&gt;
  
                &lt;p&gt;${opinion.comment}&lt;/p&gt;
                &lt;p&gt;${opinion.willReturn?&quot;I will return to this page.&quot;:&quot;Sorry, one visit was enough.&quot;}&lt;/p&gt;
             &lt;/section&gt;`;
     return opinionTemplate;
  }
  /**
  * creates html code for all opinions in an array using the opinion2html method
  * @param sourceData -  an array of visitor opinions
  * @returns {string} - html code with all the opinions
  */
  function opinionArray2html(sourceData){
     return sourceData.reduce((htmlWithOpinions,opn) =&gt; htmlWithOpinions+ this.opinion2html(opn),&quot;&quot;);
  }
  
  &lt;/script&gt;
  &lt;script  type=&quot;module&quot; src=&quot;js/myTreesFormLStorageHtmlWr.js&quot;&gt;&lt;/script&gt;
  &lt;script type=&quot;module&quot; src=&quot;js/opinionsHandlerMustache.js&quot;&gt;&lt;/script&gt;
  
  
  &lt;script id=&quot;mTmplOneOpinion&quot; type=&quot;text/template&quot;&gt;
     &lt;section&gt;
         &lt;h3&gt;{{name}} &lt;i&gt;{{createdDate}}&lt;/i&gt;&lt;/h3&gt;
         &lt;p&gt;{{comment}}&lt;/p&gt;
         &lt;p&gt;{{willReturnMessage}}&lt;/p&gt;
     &lt;/section&gt;
  &lt;/script&gt;
  </code></pre>
  <p>Simply in HTML page it should be to view a Name and Comment element from array and automaticaly refresh.
  Thank you</p>