title: Error Cannot set property 'value' of undefined
body: <pre><code>$(function() {
      $.get('http://localhost/rand.php', function(data){
          document.getElementsByName('login')[0].value='data';
          console.log(data);
      });
  });
  </code></pre>
  
  <p>what is the problem in these code. they are giving me error like "background.js:3 Uncaught TypeError: Cannot set property 'value' of undefined".</p>