JSFiddle - React, Tailwind, and code Playground
HTML
<html>
<body>
<a href="#" title="This is the title text">This is the default text</a>
</body>
</html>
JavaScript
// jQuery Plugin
(function($){
// Swap text with title attribute
$.fn.swapTitleAttr = function() {
var title = this.attr('title');
var text = this.text();
$(this).wrapInner('<span />');
$(this).hover(function(){
$(this).text(title).attr('rel', text).removeAttr('title');
},function(){
$(this).text(text).attr('title', title).removeAttr('rel');
});
};
})(jQuery);
$(document).ready(function(){
$('a').swapTitleAttr();
});