How to modify the value of data-tooltip? I would like to do that with one line of code.
Here is the element:
<li class="ui-btn-icon-left " data-icon="cf">
<a href="#" class="ui-btn ui-icon-cf">
<span class="tooltip" data-tooltip="NeverGiveUp">Samaras</span>
</a>
</li>
Here are two of my attempts:
$($(li).find('a').find('span').attr('data-tooltip')).val('foo');
$($(li).find('a').find('span').attr('data-tooltip')).text('foo');
which had no impact.
The shortest notation would be:
$('li a span').data('tooltip', 'foo');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With