Javascript examples for DOM Event:onmouseout
Add mouse over action event handler for all buttons returned from getElementsByTagName
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {//from www . j a v a2s . c om var buttons = document.getElementsByTagName("button"); for (var i=0; i < buttons.length; i++) { buttons[i].onmouseover = function() { console.log(buttons[i].title); } } }); </script> </head> <body> <button title="hello this is a title">Hover me</button> <button title="hello this is a title 2">Hover me</button> <button title="hello this is a title 3">Hover me</button> <button title="hello this is a title 4">Hover me</button> </body> </html>