title: Bind events to dynamic generated elements with wildcard selectors in javascript or jquery
body: <p>I have this code:</p>
  
  <pre><code>  var element= document.getElementsByRegex('^signalo-.*');
      $(document).on( 'click', element, function(){
          alert($(this).attr('id'))
      } );
  </code></pre>
  
  <p>I have unknown numbers of buttons with the <code>id</code>, all beginning with <code>"signalo-"</code> and a number after it, like <code>signalo-1</code> , <code>signalo-2</code> ....</p>
  
  <p>I know how to bind events for dynamic generated elements on page as you see in my code example, but the problem here is that for the event binding you have to pass a specific selector as the second argument which confuses me a little.
  I know how to use wildcards both with pure javascript and with jQuery and I know hot to bind events to dynamic content but what I can't figure out is how to combine them together. </p>
  
  <p>Can anyone help? </p>