Bind Events to disabled element-3

by Rohit Patel

HTML

<body>
    <input id="theButton" type="button" value="I am disabled" onmouseover="showToolTip()" onmouseout="hideToolTip()">
    <br>
    <span id="tooltip"></span>
</body>

CSS

#theButton {
  pointer-events: visible;
  color: graytext;
}

JavaScript

function showToolTip() {
  document.getElementById("tooltip").textContent = "I am tooltip text";
}

function hideToolTip() {
  document.getElementById("tooltip").textContent = "";
}