title: javascript - get value parameter from input text
body: <p>I want to get the value of a text input. I would like to do this by using <code>id</code> and <code>getElementById</code> :</p>
  
  <p>here HTML code :</p>
  
  <pre><code>&lt;form&gt;
    &lt;fieldset&gt;
    &lt;legend&gt;Input ordinate :&lt;/legend&gt;
    &lt;input type="text" id="ordinateId" name="input"/&gt;
    &lt;input type="button" id="startbuttonId" value="Start particle"/&gt;
    &lt;/fieldset&gt; 
  &lt;/form&gt;
  </code></pre>
  
  <p>and Javascript :</p>
  
  <pre><code>&lt;script type="text/javascript"&gt; 
  
  var button = document.getElementById("startbuttonId");
  var value = document.getElementById("ordinateId").value;
  
  console.log(value);
  button.onclick = function() {
    console.log(value);
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>but into the console, nothing appears for <code>value</code>. Where is the problem ?</p>
  
  <p>Thanks</p>