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

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -