title: Semantic-UI Popup - Change HTML before initializing
body: <p>I'm working with Semantic-UI and have a popup with an input field in it (search field). The popup is initialized/opened "on: 'click'", but I would like to set a value to the input field with javascript before the user opens the popup. </p>
  
  <p>Trying to do so with</p>
  
  <pre><code>document.getElementById("sok_tekst").value = input;
  </code></pre>
  
  <p>only leads to </p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot set property 'value' of null</p>
  </blockquote>
  
  <p>When I look in the console, I see that the HTML-code contains the popup with the input field (id="sok_tekst"), but it looks like I "can't reach it" with javascript before it's initialized. </p>
  
  <p>I feel I have tried everything, and it looks like I need to open the popup before adding a value to the input field.</p>
  
  <p>Here is a <a href="https://jsfiddle.net/dg4kj7b7/1/" rel="nofollow noreferrer">DEMO</a></p>
  
  <p>Do anyone have a trick up their sleeve for this??</p>
  
  <p>Thanks! </p>
  
  <p>For the curious: I am using the input field as a search field in a table/work plan. When the table is redrawn, by the user changing week number, the popup are redrawn as well. I'm trying to keep the search value, and put it back in the input field, in the new popup, in the new table.  </p>