title: Insert value in hidden field using jquery
body: <p>I have created a cookie using php. want to read it using javascript then want to submit cookie name using a hidden field to server.
  So 
  I want to insert cookie name in a hidden field using jquery.
  That means if cookie created i want to insert cookie name into a hidden field.</p>
  
  <p>so that url like this: localhost/backupimage/unlink.php?dirname=72-1394951508</p>
  
  <p>what will be the right procedure.</p>
  
  <pre><code>    var x = document.cookie; 
      var n=x.split("=");
      if ((n.length &gt; 0)){
         // alert(n[1]);
         $("#dirname").val(n[1]);
      }
  &lt;form action="unlink.php" id="removedata"&gt;
  
  &lt;input TYPE="submit" id="delvalue"  VALUE="Clear Data" /&gt;
  &lt;input TYPE="hidden" id="dirname" name="dirname" value=""/&gt;
  &lt;/form&gt;
  </code></pre>