Plain JavaScript tooltip

前端 未结 5 2009
渐次进展
渐次进展 2020-12-08 01:16

I am trying to make a tooltip in plain JavaScript which is shown on hover. Like the one in Stack Overflow on hover over the profile name a div is s

5条回答
  •  一生所求
    2020-12-08 01:48

    For non-customized tooltip, you can just add the message you want to display in tooltip in the title attribute of the main div. Just like this:

    Then there is no need to add the onmouseover and onmouseout event handlers.

提交回复
热议问题