Javascript question:

Okay, might sound a little confusing… lets say i have this:


<html>
<head>

<script>

function alertBob()
{
alert("Focus on Bob Please");
}


</script>

</head>
<body color="black">


<div id="bob">
hello im bob
</div>

<a href="http://bob.com">Bob's Site</a>

</body>
</html>

How would i make it, so that if i click anywhere on the body, except on a hyper link, or on the div layer “bob”, the function alertBob would be executed???

thanks in advance,
entreri

Shoot how do i not make it do html ?

try using

 instead of 

I was still able to see what you were trying to do. If I get a chance when I get home tonight I’ll write u a script.

oo fixed it thanks DP, er the PHP thing anyways, still dunno how to do this =P

yea, sorry I’ve just been busy… I’ll try tonight… If somebody has a chance they can help also.

Couldn’t you do it like this:


<html>
<head>

<script>

function alertBob()
{
alert("Focus on Bob Please");
}


</script>

</head>
<body color="black" onclick="java****script:alertBob();">


<div id="bob">
hello im bob
</div>

<a href="http://bob.com">Bob's Site</a>

</body>
</html>