title: onclick event on button is not working on block received by ajax call
body: <p>I have created a toolbar for basic database actions: insert, delete etc. It has an onclick event that is handled ok. I would like to be able to dynamically build this toolbar by php. The same code is generated but for some reason the event is not working. I tried firefox developer edition to find out, but it shows me that the original code is bound to events, but the ajax received part isn't. What am I doing wrong</p>
  
  <p>top version is working, the full (green) toolbar isn't (not bound to ev) this part was received by an ajax event</p>
  
  <p>the original html looks like this:</p>
  
  <pre><code>&lt;div class="btn-group" role="group" aria-label="hallo"&gt;
   &lt;button type="button" id="id_phspapps_dbnavigator_1_add" class="btn btn-default"&gt;Add&lt;/button&gt;
   &lt;button type="button" id="id_phspapps_dbnavigator_1_cancel" class="btn btn-default"&gt;Cancel&lt;/button&gt;
   &lt;/div&gt;
   &lt;/div&gt;
   &lt;div id="phid_phspapps_dbnavigator_1"&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>In the ondocumentready an event is triggered to retrieve the toolbar data. It looks like the setup ajax event is not bound to the fields. All buttons have their own event, like _add, _cancel as the function below for _edit:</p>
  
  <pre><code>$("#id_phspusers_dbnavigator_1_edit").click(function() {
    var str='';
     str = $( "#id_"+formid ).serialize();
    procbutton(str+'&amp;cmd=edit&amp;sender=id_phspusers_dbnavigator_1','');
  }); 
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/vSnLf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vSnLf.png" alt="enter image description here"></a></p>