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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -