title: click the generated button while loop does not work
body: <p>I have an unordered list that receives dynamic data mysql database, the list returns me some youtube links with Title thumbnail and full view of each video, I made a simple script that displays and hides a div using css disply none and display block this div that will receive the link and it will display the video, my problem is that only the first play button hides and shows the div, the other buttons dynamically created in while not working.</p>
  
  <p>Here is my HTML and PHP receiving the data bank through while</p>
  
  <pre><code>&lt;div id="player"&gt;&lt;/div&gt;
  &lt;div class="divvideos"&gt;
      &lt;ul&gt;
          &lt;?php while($videolist = $resultvideos-&gt;fetch_array()){ ?&gt;
          &lt;li class="listdivvideos"&gt;
              &lt;button class="btplay" id="btplay"&gt;&lt;/button&gt;
              &lt;img src="images/datahoraicon.png" class="imgdatahora"&gt;
              &lt;ul&gt;
                  &lt;li&gt;&lt;img src="http://i1.ytimg.com/vi/&lt;?php echo $videolist['miniatura'] ?&gt;/default.jpg"&gt;&lt;/li&gt;
              &lt;/ul&gt;
          &lt;/li&gt;
          &lt;?php } ?&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Here is the simple script to show and hide the div player</p>
  
  <pre><code>&lt;script&gt;
      $("#btplay").click(function () {
          if($("#player").css("display") == "none")
              $("#player").css("display","block");
          else
              $("#player").css("display","none");
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>My code works normally by clicking the button with the ID btplay it hides and shows the div with the id player, my only problem is that this button is created several times because the While it is created in the home line that returns the while but only the primero button hides and shows the div other buttons do not work</p>