Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS A question about changing CSS of pressed buttons

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #45265
    yaronkadem
    Member

    Hello all,

    I’m building a CMS using Bootstraps and I have a problem in changing the CSS of the current pressed button.

    What I’d like to achieve is when a button has been clicked its CSS is changed from (using a Javascript function or anything way else).

    Here is my HTML button code that has this Bootstraps CSS styling ‘btn btn-primary’:

    When this button is clicked, I want it to have only this CSS styling ‘btn’ instead of ‘btn btn-primary’ so the user has indication of what page they’re in.

    Any suggestions will be welcome.

    Thanks
    Yaron

    #136693
    yaronkadem
    Member

    Hi Melindrea,

    That was really fast!!

    Thanks a lot for that, I’ll try to implement.

    Thanks again!

    Yaron

    #136696
    yaronkadem
    Member

    It works!
    I’ve got one last question please, what if I had a few buttons? #mybtn1, #mybtn2 and etc..?

    #136697
    Merri
    Participant

    I throw this as a counter question. This is in a general context, not specific to your project. What do you get if you call:

    1. `$(‘body’);`
    2. `$(‘div’);`
    3. `$(‘div,span’);`

    #136699
    yaronkadem
    Member

    I managed to handle this.

    thanks a lot!

    #136708
    yaronkadem
    Member

    Thanks again for your comments.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘CSS’ is closed to new topics and replies.