title: Set the background color of the parentNode associated with an input box's value being null
body: <p>Here is my code. When the button is clicked and the value of "requiredTitleValue" is null. The background color of the parent node associated with the  tag should be set to "red". The problem is that the new backgroundColor is not sticking after the button click.</p>
  
  <p>backgroundColor should stick after submit button is clicked and "requiredTitleValue" is null but it is not.</p>
  
  <pre><code>var checkTitleValue = function(){
      var requiredTitleObject = document.getElementById("requiredTitle");
      var requiredTitleValue = requiredTitleObject.nodeValue;
  
      if(requiredTitleValue == null){
          alert("Object is null");
          requiredTitleObject.style.backgroundColor = "red";
          requiredTitleObject.parentNode.style.backgroundColor = "red";
      }
  } 
  
  function formValidator(){
      checkTitleValue();
  }
  
  
  
  
  </code></pre>