Jquery getting value from a hidden text field
<p>I am trying to use jquery to get value from a hidden text field but no success.
This is the javascript function which is adding html to the page dynamically.</p>

<pre><code>          function(lng,lat)
          {
             document.getElementsByClassName("BranchDetails").item(0).innerHTML+=""
          +" &lt;div class='Branches'&gt;"
          +"     &lt;div class='DeleteIcon'&gt;&lt;img src='../Images/deleteicon.png' width='15' height='15'&gt;&lt;/div&gt;"

          +"     &lt;div class='BranchName'&gt;"
          +"      &lt;div class='CompanyBranchNameText'&gt;"
          +"          Company Name"
          +"      &lt;/div&gt;"


          +"      &lt;div class='EditCompanyBranchName'&gt;"
          +"          &lt;label&gt;Company Name:&lt;/label&gt;&lt;input type='text' class='EditNameText' &gt;"
          +"          &lt;input type='hidden' class='longitudeVal' value='"+lng+"' /&gt;&lt;input type='hidden' class='latitudeVal' value='"+lat+"' /&gt;"
          +"      &lt;/div&gt;"
          +"      &lt;a href='javascript:void(0)' class='EditNameLink'&gt;&lt;p&gt;edit...&lt;/p&gt;&lt;/a&gt;"
          +"    &lt;/div&gt;"
          +" &lt;/div&gt;";
          }
</code></pre>

<p>Now I want to get the values of hidden text fields.
So far what i've done is.</p>

<pre><code>           $('.Branches').children('.DeleteIcon').click(

        function()
        {
               alert($(this).siblings('.EditCompanyBranchName').children('.longitudeVal').val());
        }
             );
</code></pre>

<p>But this is returning me an undefined value.
The lng and lat values are being put in the hidden fields successfully i've checked it using alert boxes.</p>
