i have following code
but it does not toggling classCode:<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="switchclass.aspx.cs" Inherits="ajax.switchclass" %> <!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>Untitled Page</title> <script src="jquery.js" type="text/javascript"> $(document).ready(function(){ $("button").click(function(){ $("p").toggleClass("main"); }); }); </script> <style type="text/css"> .main { font-size:120%; color:red; } </style> </head> <body> <form id="form1" runat="server"> <div> <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" /> <p>This is another paragraph.</p> </div> </form> </body> </html>




Reply With Quote