title: Click event for button on 2nd page of multi-page jquerymobile document does not fire
body: <p>My simple mobile app has 3 pages all demarcated with divs/ <code>data-role="page"</code> and within the same document (.html). The pages load up perfectly but if I navigate to the 2nd page, a very simple click event on a button does not work.</p>
  
  <p>In the  I have the following within script tags:</p>
  
  <pre><code>$('#igetdetails').click(function () {
      alert("hello");
  })
  </code></pre>
  
  <p><code>igetdetails</code> being the id of the button. The alert never pops up.</p>
  
  <p>When I place this code within the pageinit event of that page however, it pops up immediately the page is loaded. </p>
  
  <p>This tells me there must be something very simple I'm missing out but after 8 hours of strain and pain I'm reaching out for help.</p>
  
  <p>Here's the full head section:</p>
  
  <p>
  </p>
  
  <pre><code>&lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
      &lt;title&gt;
      &lt;/title&gt;
      &lt;link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.1.1/jquery.mobile-1.1.1.min.css"
      /&gt;
      &lt;link rel="stylesheet" href="my.css" /&gt;
      &lt;style&gt;
          /* App custom styles */
      &lt;/style&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"&gt;
      &lt;/script&gt;
      &lt;script src="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.1.1/jquery.mobile-1.1.1.min.js"&gt;
      &lt;/script&gt;
      &lt;script src="my.js"&gt;
      &lt;/script&gt;
      &lt;script&gt;
    //  Invoice = new Object();
     $( '#page1' ).live( 'pageinit',function(event){
          //alert( 'This page was just enhanced by jQuery Mobile!' );
  
  
         // Ajax Called When Page is Load/Ready (Load Customers)
          jQuery.ajax({
              url: 'list_customers.php',
              global: false,
              type: "POST",
              dataType: "xml",
              async: false,    
              success: populateCustomers
          }); 
  
          jQuery.ajax({
              url: 'list_salesmen.php',
              global: false,
              type: "POST",
              dataType: "xml",
              async: false,    
              success: populateSalesmen
          }); 
  
          $("#iinv_customer").bind( "change", function(event, ui) {
              Invoice.CustomerID = $('#iinv_customer').val();                
          });
          $("#iinv_salesman").bind( "change", function(event, ui) {
              Invoice.SalesmanID = $('#iinv_salesman').val();                
          });
          $("#iinv_date").bind( "change", function(event, ui) {
              Invoice.Date = $('#iinv_date').val();                
          });
          $("#iinv_no").bind( "change", function(event, ui) {
              Invoice.invno = $('#iinv_no').val();                
          });
          $("#iinv_add").bind( "click", function(event, ui) {
  
              $('#iinv_customer').selectmenu('disable');
              $('#iinv_salesman').selectmenu('disable');
              $('#iinv_no').textinput('disable');
              $('#iinv_date').textinput('disable');                
  
              $.mobile.changePage("#page4");
          });
          $("#iinv_cancel").bind( "click", function(event, ui) {
  
              $('#iinv_customer').selectmenu('disable');
              $('#iinv_salesman').selectmenu('disable');
              $('#iinv_no').textinput('disable');
              $('#iinv_date').textinput('disable');                
  
              //$('#page1').reset();
              location.reload();
          });
  
      });
  
       $( '#page4' ).live( 'pageinit',function(event){
          //alert( 'This page was just enhanced by jQuery Mobile!' );
  
          //$('#iSelectedCustomer').html($('#iinv_customer').val());
          $('#iSelectedCustomer').html($("#iinv_customer option[value='" + $('#iinv_customer').val() +"']").text());
         // document.getElementById("iSelectedCustomer").innerHTML = $('#iSelectedCustomer').html();
              //var element = document.getElementById('iSelectedCustomer');
              //alert(element.value);
              //element.value = $('#iinv_customer').value;
              //alert(element.value);
      //    var selected = $(#iinv_customer).val;
  
       //   $('#iSelectedCustomer').val(selected);
  
         jQuery.ajax({
              url: 'list_products.php',
              global: false,
              type: "POST",
              dataType: "xml",
              async: false,    
              success: populateProducts
          }); 
  
       });
  
       $('#igetdetails').click(function () 
       {    
           alert("hello");
       //$("#ili_prod").bind( "change", function(event, ui) {
       //var data = { prod: 12};
       var data = { prod: $("#ili_prod").val()};
       // prodid = $(this).attr('value');
  
       jQuery.ajax({
          url: 'get_products_details.php',
          type: "POST",
          dataType: "xml",
          data:data,
          async: false,    
          success: populateProductsDetails
  
       });
       alert($("#ili_prod").val());
       alert("hello");
       });
  
  
  
      &lt;/script&gt;
  &lt;/head&gt;
  </code></pre>