$(function() { document.getElementById("JPG1").onmouseover = function() { $("[name=NameJPG]").each( function(n, item) { item.style.display = "none"; } ); } });
$(function() { $('#JPG1').on('mouseover', '[name=NameJPG]', function() { $(this).hide(); }); });
$(this).hide();
<ul class="list"> <li class="item">1</li> <li class="item">2</li> <li class="item">3</li> <li class="item">4</li> <li class="item">5</li> </ul> <script src="https://code.jquery.com/jquery-2.1.4.js"></script> <script> $(function() { $('.list').on('mouseover', '.item', function() { $(this).hide(); console.log($(this)); }); }); </script>