Adding className To Button In Collection

Adding className To Button In Collection

chboccachbocca Posts: 90Questions: 14Answers: 1

Hi again.

Using jQuery, I can easily add a className to a dt-button, but I'm struggling to add a className to a button inside a collection.

Here is demo.

Press 'Add Class All Buttons' and the className 'nohover' has been added to all top-level buttons, except the three buttons inside the button named "Collection."

Press 'Add Class To Button 1 of Collection' fails to add className, despite several jQuery attempts. Just can't figure-out how to call the right element.

Would very much appreciate any guidance.

Thank you in advance, as always.

Charles

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,321Questions: 26Answers: 4,948
    Answer ✓

    Try using button().node() instead of direct jquery selectors.

    Kevin

  • chboccachbocca Posts: 90Questions: 14Answers: 1

    Love you kthorngren. That worked!

    I've updated the demo to reflect your solution.

    c

Sign In or Register to comment.