title: JQuery datepicker on click on label
body: <p>I want a JQuery datepicker to show when I click on a specific label. I have a HTML like this:</p>
  
  <pre><code>&lt;label id="kezd_datum_label"&gt;Data&lt;/label&gt;&lt;input style="display:none;" id="kezd_datum" /&gt;
  </code></pre>
  
  <p>And some following JQueries like these:</p>
  
  <pre><code>$( function() {
     $( "#kezd_datum" ).datepicker({
           dateFormat:"yy-mm-dd"        
     });
  } );
  
   $("#kezd_datum_label").click(function() {
       $("#kezd_datum").datepicker("show");
   });
  </code></pre>
  
  <p>And</p>
  
  <pre><code>$(document).ready(function() {
       $( "#kezd_datum" ).datepicker({
           dateFormat:"yy-mm-dd"        
       });
  
   $("#kezd_datum_label").click(function() {
       $("#kezd_datum").focus();
   });           
  });
  </code></pre>
  
  <p>I tried to copy the codes from here <a href="https://stackoverflow.com/questions/43605222/jquery-datepicker-on-click-of-icon">jQuery datepicker on click of icon</a>, and it was accepted and everyone says it works, but it does not for some reason. However, if I make input visible, the datepicker appears as it should. Just not if I click on that label.</p>
  
  <p>If a put in a <code>window.alert("something");</code> into any of the click functions, they also run and appear.</p>