html标签的title

  给html的标签 比如 div 加上 title 类型,则相当于鼠标接触事件,鼠标移动上去就可显示title的内容

1         var icon = document.createElement('div');
2         icon.className = 'icon';
3         icon.title = information;     // here
4         document.getElementById('contain').appendChild(icon);    
<div id="hl" title="123"></div>

  对了,这不就和img一样吗。

  不过这样省事的鼠标事件是何其的丑==

posted @ 2019-11-26 19:57  allOfme  阅读(445)  评论(0)    收藏  举报