0

Help me to check buttons css class inside UI Tabs and add another one. I have some buttons. All buttons placed inside UI one tab.

I want to add another one class "red" if span.jrIconStar.

<button class="Button" data-states='{"on":"jrIconStar","off":"jrIconEmptyStar"}'>

  <span title="Main Photo" class="jrIconStar"></span>

</button>                                                             
<button class="Button" data-states='{"on":"jrIconStar","off":"jrIconEmptyStar"}'>

  <span title="Photo" class="jrIconEmptyStar"></span>

</button>

img

1

1 Answer 1

0

If I understand correctly, you want to add a given class to your span with id jrIconStar. To achieve this use the following jQuery code:

jQuery("#jrIconStar").addClass("className") or $("#jrIconStar").addClass("className") If you want this to happen on a button click then you can use it in the following way:

$("body").on("click", "#yourButtonId", function(){ $("#jrIconStar").addClass("className"); });

If this is not the case please provide us with more information! Hope this helps you out!

EDIT:

https://stackoverflow.com/a/3271277/7654934

I believe this is the answer that you are looking for.

Sign up to request clarification or add additional context in comments.

7 Comments

this code not working in my case, as i sad this buttons inside jQuery UI Tabs. But i don't understand how to (
If you provide me with a jsFiddle of your issue I will take a look and try to help you out!
Not quite that. my buttons inside one tab, i don't need to switch between tabs.
Just use the logic to change your class?
can i speak Russian here ?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.