title: Pass data from array to array
body: <p>So I have these lines in my code:</p>
  
  <p>it reads/checks what data is in the input</p>
  
  <pre><code>inp.value = this.getElementsByTagName("input")[0].value;
  </code></pre>
  
  <p>this set the value of the second field based on the array var pass = { };</p>
  
  <pre><code>myPW.value = pass[inp.value];
  </code></pre>
  
  <p>I have arrays that stored user's input</p>
  
  <pre><code>inputData = []; //data from the first field
  inputPW = []; //data from the second field
  </code></pre>
  
  <p>so in var pass = { }; it should be look like this </p>
  
  <pre><code>var pass = { inputData : inputPW }
  </code></pre>
  
  <p>This is my logic but inputPW from var pass is undefined. So what happened here is that all the username from the local storage is autocompleted, when user typed something from the username field, it will auto sugggest his/her username that he/she submitted. Then after selecting, it will automatically pass the password to the password field. But after documenting it (if u try to submit it again) the password is undefined.</p>