div onMouseOut question..

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
Wrathrowe
Forum Newbie
Posts: 7
Joined: Fri Feb 19, 2010 6:18 am

div onMouseOut question..

Post by Wrathrowe »

So I have two divs contained in another div, on the outside div onMouseOut I want to alert the id, but when I run my mouse over the two divs contained inside I get a mouseOut condition. This is driving me crazy, any help is greatly appreciated! Here is my code.

Code: Select all

<html>
	<head>
		<script type='text/javascript'>
			function getId(id){
				alert(id);
			}
		</script>
	<body>
		<div id='holder' onMouseOut='getId(this.id)' style='width:100; height:100; border:2px solid black;'>
			<div id='inside1' style='cursor:pointer;'>Text1</div>
			<div id='inside2' style='cursor:pointer;'>Text2</div>
		</div>
	</body>
</html>
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Re: div onMouseOut question..

Post by kaszu »

That's just how mouseover and mouseout works. Google "mouseenter" and "mouseleave"
Post Reply