0

I have this code :

<span id="sn1">
<a href="javascript:removeEtape(2);" class="glyphicon glyphicon-remove"></a>
<a id="aUn1" href="javascript:upEtape(1,0);" class="glyphicon glyphicon-chevron-up" aria-hidden="true"></a>
<a id="aDn1" href="javascript:downEtape(1,2);" class="glyphicon glyphicon-chevron-down" aria-hidden="true"></a>
my text here<br></span>

I need change color of "glyphicon glyphicon-chevron-up" after I have selected id "aUn1".

I try this but, it doesn't works :

$('#aUn1').attr('[class$="glyphicon-chevron-up"]').css('color', 'grey');

Can you help me please ?

2 Answers 2

2

Just add the class to the selector.

$('#aUn1.glyphicon-chevron-up').css('color', 'grey');
Sign up to request clarification or add additional context in comments.

Comments

-1

Update your code like this

$(".glyphicon-chevron-up").css('color', 'grey');

1 Comment

Now you got a syntax error and the answer is technically wrong too. ;)

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.