title: JQuery change input type hidden value
body: <p>I changing input type hidden over JQuery with DOM appended Buttons, code looks like </p>
  
  <pre><code>$("body").on('click', '.companyContractButt', function(){
      var id = $(this).attr('data-id');
      var what = $(this).attr('data-what');
      alert($(".selectedWhatis[data-id='"+id+"']").attr('data-id'));
      $(".selectedWhatis[data-id='"+id+"']").val(what);
      alert($(".selectedWhatis[data-id='"+id+"']").val());
  });
  </code></pre>
  
  <p>and input type hidden looks</p>
  
  <pre><code>&lt;input type='hidden' data-id='".$contract-&gt;id."' class='selectedWhatis' value='hovno'&gt;  
  </code></pre>
  
  <p>But wher I alert that input type hidden I always get undefined... I don't know why. var id and var what showing right values..</p>
  
  <p>There is function which creating DOM buttons</p>
  
  <pre><code>$("body").on('click', '.clickChange', function(){
  var id = $(this).attr('data-id');
  var nm = $(this).attr('data-name');
  
  $(".filling[data-id='"+id+"']").html('');
  $(".filling[data-id='"+id+"']").html("&lt;button class='companyContractButt' data-what='create' data-id='"+id+"'&gt;&lt;span&gt;"+$("#createTranslate").val()+"&lt;/span&gt;&lt;/button&gt; &lt;button class='companyContractButt' data-what='append' data-id='"+id+"'&gt;&lt;span&gt;"+$("#appendTranslate").val()+"&lt;/span&gt;&lt;/button&gt;&lt;br /&gt;&lt;input type='text' style='width: 200px; margin-top: 5px;' data-id='"+id+"' value='"+nm+"' class='inputingPerson'&gt;");
  $(".inputingPerson[data-id='"+id+"']").focus();
  }); 
  </code></pre>