This is my HTML :
<li class="custom-bottom-list">
<a onClick="upvote(this)"><i class="fa fa-thumbs-o-up"></i><span>upvote</span></a>
</li>
My javascript function Upvote :
function upvote(el){
$(el+' i').removeClass('fa-thumbs-o-up').addClass('fa-refresh fa-spin');
console.log( event );
}
Basically i want to select and change the css of the 'i' tag inside the particular element which is clicked.
What its doing now is its changing the css of all 'i' tags present in the page.
Can somebody tell me a efficient way to do this?
PS - I tried onClick="upvote(event)
and $(event.target).removeClass('fa-thu..
But this works only when I click the 'i' tag. When i click the span tag it changes the span's css!