Reputation: 4929
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
Reputation: 8171
You can use -
$(document).ready(function(){
$("input[name='sb_Second']").hide();
});
Upvotes: 0
Reputation: 88
You can use
$("input[name='myButton']").hide();
OR
$("input[name='myButton']").css({
'display' : 'none'
});
Upvotes: 0
Reputation: 152
You will give class name of the button with jquery hide function
<script type="javascript">
$('.button1').hide();
</script>
Upvotes: 0
Reputation: 32591
Change
$("#showButtons").hide('input[name:buttonName]');
to
$("#showButtons input[name='buttonName']").hide();
if input is inside #showButtons
Upvotes: 5
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