<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MyWebForm.aspx.cs" Inherits="JQueryTest.MyWebForm" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript" src="Script/jquery-1.7.2.min.js"></script> <link href="css/Test.css" rel="Stylesheet" type="text/css" /> <script type="text/javascript" src="Script/MyScript.js"></script> </head> <body> <form id="form1" runat="server"> <div id='banner'> <asp:Button CssClass="buttonRed" ID="Button1" OnClientClick='ChangeToBlue();' runat="server" Text="Button" /> </div> </form> </body> </html>
function ChangeToBlue() { var button1 = $('#Button1').addClass('buttonBlue'); } // Test.css // body { } .buttonRed { background-color: red; color: white; border: 3px red solid; } .buttonBlue { background-color: blue; color: white; border: 3px red solid; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)