title: Changing input value text color using javascript
body: <p>I'm newbie in JavaScript and I want to change the input element text Color but nothing happen when I load the page where I made a Mistake ?  </p>
  
  <pre><code>&lt;head&gt;
  &lt;script language="text/javascript"&gt;
          function chngcolor()
          {
              var x=document.getElemetById('status')[0].value;
              if(x=='Accept')
              {
                  x.style.color = '#00FF00';
  
              }
  
          }
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body onload="chngcolor();"&gt;
  
  &lt;form&gt;
  &lt;input type='text' name='status' id='status' value="Accept" &gt;
  &lt;/form&gt;
  
  
  &lt;/body&gt;
  </code></pre>