Results 1 to 2 of 2

Thread: Toggle class

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2007
    Location
    Karachi
    Posts
    551

    Toggle class

    i have following code

    Code:
    <%@ 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>
    but it does not toggling class
    There is no achievement without goals

  2. #2
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: Toggle class

    Is the <asp:button> rendered as a <button> tag, or an <input> tag?
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width