Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
71
rated 0 times [  76] [ 5]  / answers: 1 / hits: 160442  / 12 Years ago, mon, october 8, 2012, 12:00:00

Can someone please tell me how I can hide this button after pressing it using jQuery?



<input type=button name=Comanda value=Comanda id=Comanda data-clicked=unclicked />


Or this one:



<input type=submit  name=Vizualizeaza value=Vizualizeaza>

More From » jquery

 Answers
96

Try this:



$('input[name=Comanda]')
.click(
function ()
{
$(this).hide();
}
);


For doing everything else you can use something like this one:



$('input[name=Comanda]')
.click(
function ()
{
$(this).hide();

$(.ClassNameOfShouldBeHiddenElements).hide();
}
);


For hidding any other elements based on their IDs, use this one:



$('input[name=Comanda]')
.click(
function ()
{
$(this).hide();

$(#FirstElement).hide();
$(#SecondElement).hide();
$(#ThirdElement).hide();
}
);

[#82678] Monday, October 8, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
hasanjustusf

Total Points: 76
Total Questions: 116
Total Answers: 100

Location: Virgin Islands (U.S.)
Member since Tue, Jul 7, 2020
4 Years ago
hasanjustusf questions
;