title: Change the colour of text field in dynamics crm 2016
body: <p>I am looking to write a javascript to change the color of any text field in CRM
  Here is my javascript:</p>
  
  <pre><code>function ChangeBackgroundColor()
  {
       var revenue = window.parent.Xrm.Page.getAttribute("revenue").getValue();
       if(revenue &lt; 10000)
       {
            document.getElementById("websiteurl").style.backgroundColor = "Red";
  
       }
  }
  </code></pre>
  
  <p>It is throwing me an error saying "Cannot read property 'style' of null at ChangeBackgroundColor "</p>
  
  <p>Can i get this customization done ? If yes then how? If no then why ?</p>
  
  <p>Thanks in advance.</p>