title: jQuery.val() doesn't work on an <input> tag
body: <p>After typing something in an input, and clicking on the button, ".val()" return an empty value, any idea why?</p>
  
  <p>HTML CODE:</p>
  
  <pre><code>&lt;div class="mainClass"&gt;
      &lt;div class="class1" &gt;
         &lt;div class="class2"&gt;
           &lt;h3&gt;Settings 1&lt;/h3&gt;   
          &lt;label&gt;
             &lt;span&gt;Text 1:&lt;/span&gt;
             &lt;input type="text" name="text"&gt;
          &lt;/label&gt;
          &lt;label&gt;
             &lt;span&gt;Text 2:&lt;/span&gt;
             &lt;input type="text" name="text2"&gt;
          &lt;/label&gt;
         &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="class3" &gt;
         &lt;div class="class4"&gt;
           &lt;h3&gt;Settings 2&lt;/h3&gt;   
          &lt;label&gt;
             &lt;span&gt;Text 1:&lt;/span&gt;
             &lt;input type="text" name="text"&gt;
          &lt;/label&gt;
          &lt;label&gt;
             &lt;span&gt;Text 2:&lt;/span&gt;
             &lt;input type="text" name="text2"&gt;
          &lt;/label&gt;
         &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
   &lt;button id="Go" class="go" &gt;GO &lt;/button&gt;
  </code></pre>
  
  <p>JAVASCRIPT CODE:</p>
  
  <pre><code>$('#Go').on('click', function() {
      alert($('.class1 input').val());    //return an empty value 
      $('.class1 input').val("test");
      alert($('.class1 input').val());    //return test
  });
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>Even this doesnt work, and here i have only one input so I can't type in the wrong one:</p>
  
  <pre><code>&lt;div class="mainClass"&gt;
      &lt;div class="class1" &gt;
         &lt;div class="class2"&gt;
           &lt;h3&gt;Settings 1&lt;/h3&gt;   
          &lt;label&gt;
             &lt;span&gt;Text 1:&lt;/span&gt;
             &lt;input type="text" name="text"&gt;
          &lt;/label&gt;        
         &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
   &lt;button id="Go" class="go" &gt;GO &lt;/button&gt;
  </code></pre>
  
  <p>EDIT 2: I found a beginning of the problem...</p>
  
  <p>When I am doing that:</p>
  
  <pre><code>$('.class1 input').each(function () {
      alert($(this).attr('name') + "  value:" +$(this).val() );
  });
  </code></pre>
  
  <p>I get two "alert" like this:</p>
  
  <pre><code>text   value:
  text   value:myinputText    
  </code></pre>
  
  <p>So two  created for one  in my HTML, the first one is empty and the second one work well!
  Looking closely to my page, i found that all element are duplicated( <code>&lt;select,field, input...</code>)</p>
  
  <p>Any idea how is that possible? Am i calling two time my html file?
  And all my code is in a popup( I don't know if it can help)
  (I am new in Javascript and jQuery)</p>
  
  <p>Thanks</p>