Solved

jquery disable all buttons enable button in jquery

Posted on 2010-11-08
3
340 Views
Last Modified: 2012-05-10
lets say i have 7 buttons that are li tags but when a tab is selected the class becomes current how would i disable all the other buttons on click to return false.


<ul>
<li><a href="#" class="current"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
</ul>

Open in new window

0
Comment
Question by:stargateatlantis
  • 2
3 Comments
 
LVL 10

Expert Comment

by:Chad Smith
ID: 34088286

$('li').not(".current")

Open in new window

0
 

Author Comment

by:stargateatlantis
ID: 34088335
Would this disable all the other buttons so when a user clicks on them it will return nothing
0
 
LVL 10

Accepted Solution

by:
Chad Smith earned 500 total points
ID: 34088355
Yes this would disable all LI elements that do not have the class "current"
$('li').not(".current").attr('disabled', 'disabled');

Open in new window

0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now