title: javascript: get a function's variable's value within another function
body: <p>okay so I have this code in body:</p>
  
  <pre><code>&lt;input type="text" value="haha" id="full_name"/&gt;
  </code></pre>
  
  <p>And this code in script</p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;
      function first(){
          var nameContent=document.getElementById('full_name').value;
      }
  
      function second() {
          first();
          y=nameContent; 
          alert(y);
      }
      second();
  &lt;/script&gt;
  </code></pre>
  
  <p>I want a alert showing the value of the element full_name, but it doesn't seem to work, does anyone know why? :S</p>