Reputation: 105
I have a CSS code:
.ui-dialog-buttonset .on{
color: black;
border-radius: 7px;
}
And i want to set display = none for this using jquery:
$('#ui-dialog-buttonset .on').css('display', 'none');
It is not woring. What am I doing wrong ? Appreciate your help.
Upvotes: 0
Views: 62
Reputation: 1620
.ui-dialog-buttonset
- this is class
#ui-dialog-buttonset
- this is ID
You are changing css of different item, which probably doesn't exists on your page.
Upvotes: 0
Reputation: 58
You're telling jQuery to search for an element with id ui-dialog-buttonset because you used #. To select a class you must start with the "." like in:
$('.ui-dialog-buttonset .on').css('display', 'none');
Upvotes: 0
Reputation: 36784
ui-dialog-buttonset
is a class, not an id. So select it using a period, not a hash:
$('.ui-dialog-buttonset .on').css('display', 'none');
Upvotes: 2