title: Tampermonkey, call user script function from appended DOM object on click event
body: <p>I tried almost every solution I had found here on StackOverflow but none of them helped me out. Here's my code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>//Toolbar body
  
  var toolbarbody = '&lt;div id="scrappytoolbar" style="width:100%; height:30px; background-color: #ffea56;"&gt;' +
  '&lt;ul&gt;' +
  '&lt;li id="litabelka"&gt;Tabelka&lt;/li&gt;' +
  '&lt;li id="licena"&gt;Cena&lt;/li&gt;' +
  '&lt;li&gt;Opis&lt;/li&gt;' +
  '&lt;/div&gt;';
  
  
  //Toolbar Loading
  
  function loadToolbar() {
   $("#article-desc-wrapper").css("margin-top", "320px");
   $("#productDetailsMainInfo").after(toolbarbody); 
   $("#productDetailsHeadlineArea").after('&lt;button id="guziktestowy"&gt;Hehes&lt;/button&gt;');
      
      
      
  }
  
  setTimeout(loadToolbar, 2000);</code></pre>
  </div>
  </div>
  </p>
  
  <p>After appending the HTML I want to add a listener on <code>li#litabelka</code> to execute some userscript code. I tried both jQuery <code>onclick</code> and vanilla javascript <code>addEventListener</code> but the click event is not executing - nothing happens on click.</p>