vivek
vivek

Reputation: 4929

How to hide a single button in div

I want to hide a single button in many buttons in div by using button name. Is that possible?
I tried

$("#showButtons").hide('input[name:buttonName]');

But it deletes all buttons in that div.

Upvotes: 4

Views: 98

Answers (5)

Ishan Jain
Ishan Jain

Reputation: 8171

You can use -

$(document).ready(function(){
    $("input[name='sb_Second']").hide();
 });

Try

Upvotes: 0

Hari
Hari

Reputation: 88

You can use

$("input[name='myButton']").hide();

OR

$("input[name='myButton']").css({
    'display' : 'none'
});

Upvotes: 0

Punitha
Punitha

Reputation: 152

You will give class name of the button with jquery hide function

<script type="javascript">
$('.button1').hide();
</script>

Upvotes: 0

Anton
Anton

Reputation: 32591

Change

$("#showButtons").hide('input[name:buttonName]');

to

$("#showButtons input[name='buttonName']").hide();

if input is inside #showButtons

Upvotes: 5

Darren
Darren

Reputation: 70814

Are you looking for:

$("input[name=buttonName]").hide();

Or to hide buttons that are in the showButtons div:

$("#showButtons input[name=buttonName]").hide();

Upvotes: 2

Related Questions