title: How to access the programmatically generated elements using jQuery
body: <p>How can I access a dynamically created element using jQuery? Suppose I have the following code:</p>
  
  <pre><code>for (var i = 0; i &lt; count; i++)
  {
      var div = document.createElement("div");
      div.setAttribute("id", "divHour" + i);
  
      var button = document.createElement("button");
      button.setAttribute("id", "btnHour" + i);
  
      div.appendChild(button);
      document.getElementById("divHours").appendChild(div);
  }
  </code></pre>
  
  <p>How can I access the buttons using jQuery?</p>