Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

jquery disable all buttons enable button in jquery

Posted on 2010-11-08
3
Medium Priority
?
355 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
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…

722 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