Can the value of the title
attribute for <i>
be toggled?
For example, if the title is set to
<i title="Favorite This Post" class="fa fa-star-o" aria-hidden="true">
within <div class="postoption">
I would like to toggle both the title text and its class using the following code:
$('.postoption').click(function(){
$(this).find('i').toggleClass('fa-star-o fa-star');
$(this).find('i').toggleTitle('Favorite This Post *OR* Remove Favorite')
});