title: javascript - Fill the value attribute of an input box
body: <p>I am trying to make a simple webapp.
  I want to put data from the main page into an input box on another window/tab but the input box is always empty when I'm opening it.</p>
  
  <p>Here's the code:
  <strong>global.js</strong></p>
  
  <pre><code>function showUserInfo(event) {
  
  // Prevent Link from Firing
  event.preventDefault();
  
  var _id = $(this).attr('rel');
  var arrayPosition = userListData.map(function(arrayItem) { return    arrayItem._id; }).indexOf(_id);
  
  // Get our User Object
  var thisUserObject = userListData[arrayPosition];
  window.open('http://localhost:3000/editrecord', 'window', 'width=500,height=400');
  var fName = thisUserObject.cName
  $("#inputecName").attr('value', fname);
  </code></pre>
  
  <p>Running this would open the 'editrecord' window and the data I am trying to get should be in the input box in 'editrecord' page.</p>
  
  <p><strong>editrecord.jade</strong></p>
  
  <pre><code>#editBox
       fieldset
            input#inputecName(type='text', placeholder='Customer Name', width = '50%')
            br
            button#btnEditRec(type='submit') Update Record
  </code></pre>
  
  <p>Thank you in advance.</p>