title: How to call function inside the inner.html
body: <p>This is my normal function in <code>JS</code> file. I need to <code>closeHomeScreenPopup</code>  function which is defined inside the <code>document.getElementById("addToHomeScreenPrompt").innerHTML</code>. I have passed <code>onclick</code> as string as you can see.</p>
  
  <pre><code>export default function register() {
    // Checks if should display install popup notification:
    if (isIos() &amp;&amp; !isInStandaloneMode()) {
      function closeHomeScreenPopup() {
        console.log("jkjilkjlkjlkjlkjlkjlk");
      }
      document.getElementById("addToHomeScreenPrompt").innerHTML =
        '&lt;div onclick="closeHomeScreenPopup()"&gt;&lt;span class="plush--sign"&gt;+&lt;/span&gt;&lt;p&gt;Install the webapp on your iPhone:tap &lt;img style="width: 20px; margin: 0 4px;" alt="" src="img/share_icon.png"/&gt; and then Add to homescreen.&lt;/p&gt;&lt;/div&gt;';
    }
  }
  </code></pre>
  
  <p>But I get error when do <code>onclick</code> on the <code>div</code></p>
  
  <pre><code>Uncaught ReferenceError: closeHomeScreenPopup is not defined
      at HTMLDivElement.onclick (temperature-schedule?roomId=2:51)
  </code></pre>
  
  <p>How can I call the <code>closeHomeScreenPopup</code> from inside <code>inner.html</code></p>