jquery disable all buttons enable button in jquery

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

stargateatlantisAsked:
Who is Participating?
 
Chad SmithConnect With a Mentor Software EngineerCommented:
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
 
Chad SmithSoftware EngineerCommented:

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

Open in new window

0
 
stargateatlantisAuthor Commented:
Would this disable all the other buttons so when a user clicks on them it will return nothing
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.