title: Colour value of TextBox vanishes after JS function is executed in asp.net?
body: <p>The colour property of TexBox vanishes (blinks) when property is set through the below JS function. Please advice, how to retain the colour property?</p>
  
  <p>(i.e once the button is clicked the colour (green for odd and red for even) blinks and colour goes back to blank)</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function numbercheck() {
    var num = document.getElementById("txtnum").value;
  
    if (num == "") {
      alert("Please Enter number")
    } else {
      if (num % 2 == 0) {
        alert("You have entered even number");
        document.getElementById("txtnum").style.backgroundColor = "green";
      } else {
        alert("You have enetered Odd number");
        document.getElementById("txtnum").style.backgroundColor = "red";
      }
    }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;p&gt; Please enter a Number :
    &lt;asp:TextBox ID="txtnum" runat="server"&gt;&lt;/asp:TextBox&gt;
  &lt;/p&gt;
  &lt;asp:Button Text="Check Number" ID="btnnum" runat="server" OnClientClick="return numbercheck()" /&gt;</code></pre>
  </div>
  </div>
  </p>