Dynamically Change Label Font Famil C# and JQuery

Jayakumars
Posted by Jayakumars under ASP.NET AJAX category on | Points: 40 | Views : 2471
hi

Label lbl1 = new Label();
lbl1.Style.Add("style", "Arial, Tahoma;Color:red;");
lbl1.Text = "Jesus Never Fails";
form1.Controls.Add(lbl1);


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<style type ="text/css">
.FntFamly
{
font-family: Arial Tahoma Times New Roman;
color:Red;
}
</style>
<script>
$(document).ready(function () {
$("#lbl1").html('Jesus Never Fails.');
$("#lbl1").addClass("FntFamly");
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="lbl1" runat ="server"></asp:Label>
</div>
</form>
</body>
</html>

Comments or Responses

Login to post response