title: Jquery Duplicate Jquery selector
body: <p>I am trying to build a contact form error caller. </p>
  
  <p>My Jquery code just said Duplicate jQuery Selector <a href="https://stackoverflow.com/questions/13705707/jetbrains-phpstorm-5-0-4-tells-me-i-have-a-duplicated-jquery-selector">closest thing i could find</a> to the same problem as me. but i tried implementing the fix people gave on that question but it did not work. ill show what i tried. and maybe someone sees the problem here. </p>
  
  <p>here is my code. </p>
  
  <pre><code>&lt;script&gt;
          $(document).ready(function () {
              $("#submit").click(function (e) {
                  e.preventDefault();
  
                  var $name = $("#name"),
                      $email = $("#email"),
                      $phone = $("#phone"),
                      $address = $("#address"),
                      $message = $("#message");
  
                  var $name_error = $("#name_error"),
                      $email_error = $("#email_error"),
                      $telephone_error = $("#telephone_error"),
                      $message_error = $("#message_error"),
                      $address_error = $("#address");
  
  
                  var data = {
                      name: $name.val(),
                      email: $email.val(),
                      telephone: $phone.val(),
                      address: $address.val(),
                      message: $message.val()
                  };
  
                  $.ajax({
                      type: "POST",
                      url: "/api/contact/submit",
                      data: data,
                      success: function (data) {
                          console.log(data);
                          $('#error_list').empty();
                          $('#show_error').hide();
                          if (data.hasOwnProperty('errors')) {
                              // Show de errors.
  
                              $.each(data.errors, function (entry) {
                                  switch (entry) {
                                      case 'email':
                                          $('#error_list').append('&lt;li&gt;' + data.errors.email + '&lt;/li&gt;');
                                          $email_error.show();
                                          break;
                                      case 'name':
                                          $('#error_list').append('&lt;li&gt;' + data.errors.name + '&lt;/li&gt;');
                                          $name_error.show();
                                          break;
                                      case 'message':
                                          $('#error_list').append('&lt;li&gt;' + data.errors.message + '&lt;/li&gt;');
                                          $message_error.show();
                                          break;
                                      case 'message':
                                          $telephone_error.show();
                                          break;
                                      case 'message':
                                          $address_error.show();
                                          break;
                                  }
                              });
  
  
                              $('#show_error').show();
                          }
                          console.log("banaan");
                          // Reset het form
                          // Show succcess
                          $("#contact-form").trigger('reset');
                          $("#success_message").show();
                      },
                      dataType: "json"
                  });
              });
          });
      &lt;/script&gt;
  </code></pre>
  
  <p>The <code>var</code> tags give me this error. and it said at as example <code>("#name")</code> that it is an duplicate selector. but at first i had the vars the same. so <code>var $name</code> and <code>var $name_error</code>were the same value: <code>("#name")</code> now i changed one to  <code>("#name_error")</code> and nowhere else i call uppon  <code>("#name")</code> and it keeps saying that its an duplicate.</p>
  
  <p>if someone can explain this error to me or have an fix for this i would be happy the documentation says the same. that you have to give every value a specific name and i did just that but still its saying the error.</p>