JSFiddle - React, Tailwind, and code Playground
HTML
<a href="service.php" title="services for cars">hello</a>
<a href="service.php" title="services for cars 2">hello</a>
<a href="service.php" title="services for cars 3">hello</a>
<button type="button" onclick="Test();">Check second title</button>
JavaScript
window.onload = function() {
var links = document.getElementsByTagName("a");
for (var i = 0; i < links.length; i++) {
var link = links[i];
link.onmouseover = function() {
this.setAttribute("org_title", this.title);
this.title = "";
};
link.onmouseout = function() {
this.title = this.getAttribute("org_title");
};
}
};
function Test() {
alert(document.getElementsByTagName("a")[1].title);
}