Found on the Internet this code
<html> <head> <style> .hover { display: none; } </style> </head> <body> <div id="w1"> <div id="block">Сюда надо навести</div> </div> <div id="w2"> <div rel="block" class="hover">Текст появится</div> </div> <script> var bl = document.getElementById('block'), hv = document.querySelector('.hover'); bl.onmouseover = function () { hv.style.display = 'block'; } hv.onmouseout = function () { hv.style.display = 'none'; } </script> </body> </html> Why does the code stop working when the block element is renamed? I want to make sure that there are 3 elements on one page when you hover over which different messages should appear.
http://jsfiddle.net/3pgbdq6m/ - does not work already