title: Is it possible to have acces to innerHTML 'id' from otger part of the code?
body: <p>I have following code, where, based on event, I add some html code. I would like to refer to 'id' from this dynamically injected html in other event (or just from other part of the code):</p>
  <pre><code>&lt;div id=&quot;choice&quot;&gt;&lt;/div&gt;
  </code></pre>
  <pre><code>var decisionList = document.getElementById(&quot;decisionList&quot;);
  
  decisionList.addEventListener(&quot;change&quot;, function () {
  
  var finalChoice = document.getElementById(&quot;choice&quot;);
  finalChoice.innerHTML='&lt;input id=&quot;finalDate&quot; type=&quot;date&quot;&gt;'  
           
   }
  </code></pre>
  <p>and other event referring to 'id' from innerHTML:</p>
  <pre><code>var payment = document.getElementById(&quot;finalDate&quot;);
  
  payment.addEventListener(&quot;change&quot;, function () {
  
  var textDate = payment.textContent; 
  alert(textDate);
  
  })
  </code></pre>
  <p>The above is not working. Is it possible or not?</p>