javascript - How to add a small description window when mouse cursor is over a element class? -
i tested method see if works, but... no, see:
var classname = document.getelementsbyclassname('avatartestcx'); function myfunction() { document.write("test."); } for(var i=0;i<classname.length;i++){ classname[i].addeventlistener('mouseover', myfunction, false); }
when mouse cursor element class, calls function write in document (it's test verify if possible small description window).
it's not working...
do have method example?
if it's simple tooltip guess title
attribute done. here example fiddle http://jsfiddle.net/542jwva8/1/
var classname = document.getelementsbyclassname('avatartestcx'); for(var i=0;i<classname.length;i++){ classname[i].setattribute("title", "small description \n line"); }
Comments
Post a Comment