title: not able to get value of labels that I have set in javascript
body: <p>I am setting the value of two labels using javascript. My code works fine when I set the text of the two labels. However, I want to use text of label on a button click, but I am not able to get the value of the label.</p>
  
  <p>My javascript is like this:</p>
  
  <pre><code>&lt;script type="text/javascript" language="javascript"&gt;
      function getIndex(index, x,fid) {
      // alert('You have Selected Flight Number:' + index);
  
      if (x == "a") {
         document.getElementById('lblAmount').innerHTML = index;
         document.getElementById('lblFlight1').innerHTML = fid;
      }
      if (x == "b") {
         document.getElementById('lblAmount1').innerHTML = index;
         document.getElementById('lblFlight2').innerHTML = fid;
      }
  
      var am1, am2, amount;
      am1 = document.getElementById('lblAmount').innerHTML;
      am2 = document.getElementById('lblAmount1').innerHTML;
      amount = parseFloat(am1) + parseFloat(am2);
  
      document.getElementById('Amount').innerHTML = amount.toString();
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>My two labels are : </p>
  
  <pre><code>&lt;asp:Label ID="lblFlight1" runat="server" Text=""&gt;&lt;/asp:Label&gt;
  &lt;asp:Label ID="lblFlight2" runat="server" Text=""&gt;&lt;/asp:Label
  </code></pre>
  
  <p>The code where I get the values of the labels:</p>
  
  <pre><code>Dim f1 As String = lblFlight1.Text
  Dim f2 As String = lblFlight2.Text
  Response.Redirect("AirPrice.aspx?Flight1=" &amp; f1 &amp; "&amp;Flight2=" &amp; f2)
  </code></pre>