title: How to change the colour of placeholder using javascript?
body: <p><i>I want to change the colour of this placeholder after calling mobileValidate().</i></p>
  
  <pre><code>&lt;input type="text" class="form-control" name="InputMobile" id="Mobile"    placeholder="Enter Mobile Number" onblur="mobileValidate()"required&gt;
  </code></pre>
  
  <p>JavaScript function is</p>
  
  <pre><code>function mobileValidate(){
  
      var x = document.getElementById("Mobile");
  
          if ((x.value).match(re)){
              alert("mobile Number is valid");
          }
          else{
  
              alert("mobile no is not valid");
              x.value="";
              x.placeholder.style.color="red";
          }
  
  }
  </code></pre>