jquery - Best way to hide a button with .visible-desktop class? -


i'm trying hide button using jquery ( using $.fn.hide()) ,but jquery method not work, because elements want hide contains bootstrap .visible-desktop/.hidden-desktop class (using bootstrap's responsive class, really). happens due .visible-desktop using display attribute !important. want display button version mobile/tablet different desktop version but want use 2 buttons unique identity. simpler version of issue be:

in html file:

<button class="my-button my-button-for-tablet-mobile hidden-desktop"></button> <button class="my-button my-button-for-desktop visible-desktop"></button> 

in jquery file (desired, not work):

//a line of type should hide 2 buttons. $(".my-button").hide(); 

i don't know better way implement this...

edit:

there jsfiddle question:

http://jsfiddle.net/bdlnn/

one way use attr() override it.

the following should work:

$('.my-button').attr('style', 'display: none !important') 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -