Tuesday, November 3, 2009
In order to change the CSS class applied to an element using jQuery we can use methods like
addClass() and .removeClass()
But if we want to change or toggle CSS class between two classes during some events like button click we can use method toggleClass() like below.
Say on click we need to change class from "btn_submit" and "btn_submit_active" or vise versa
if element has class "btn_submit_active" toggle to use "btn_submit". here we use toggleClass() method twise.
Also Read other Top Articles
- JSON Serialization in VS 2008
- Implementing Forms Authentication in Silverlight Application.
- Making GridView Rows or Individual Cells Clickable and Selectable.
- Enabling browser back button for GridView Paging and Sorting in Ajax 1.1 and 3.5 (using Visual Studio 2005/ Visual studio 2008)
- How to pass values from User Control to Page or calling Page methods from User Control.
- What is WCF?
- New features in C# 4.0
- C# to VB.NET and VB.NET to C# online free converter tools.