In one of my li elements, I have a glyphicon-ok
. Initially, I styled all glyphicon-ok elements to be green like this:
.glyphicon-ok {
color: #41be47;
}
Here is an example of the li element:
<li class="active">
<a href="#" onclick="return getQuestions(this);">
<span class="glyphicon glyphicon-ok"></span>
test
<i class="glyphicon glyphicon-remove pull-right" style="display: block;" ></i>
</a>
</li>
Now, when that specific li element is clicked, I want to change the color of glyphicon-ok
to white.
What should I include inside the
function getQuestions(id) {
}
I attempted
function getQuestions(id) {
$('span').find('.glyphicon-ok').css('color','#fff');
}