Ways of changing Text Color

Posted by Rajesh_Kumar under JavaScript category on | Points: 40 | Views : 580
1st way:
using style'color property inside Javascript function

document.getElementById("TextBox1").style.color = "orange";
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
2nd way:
using style'color property as in-line
<asp:TextBox ID="TextBox2" runat="server" style="color:red;"></asp:TextBox>
3rd way:
string.fontcolor() method as

var name = "Rajesh Sathua";
var output = name.fontcolor("green");
document.getElementById("div1").innerHTML = output;

<div id="div1">

Comments or Responses

Login to post response