title: Resolve javascript promise on DOM event
body: <p>I've been looking for an answer but couldn't find none for my issue (or at least I didn't understand how to make it work for mine.) So I have this function:</p>
  
  <pre><code>Test.prototype.testing = function(){
    return new Promise(function (resolve, reject){
      document.getElementById("element").innerHTML = 
        "&lt;button onclick=\"\"&gt;Next&lt;/button&gt;";
    });
  };
  </code></pre>
  
  <p>How can I make the promise resolve on button click? Thanks in advance.</p>