Yes, it works but you have to subtract the height of the div from the scrollHeight.
Follow this quick example:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script type="text/javascript">
function foo(){
if(document.getElementById('x').scrollTop==(document.getElementById('x').scrollHeight-parseInt(document.getElementById('x').style.height))){
alert('yes!');
} else {
alert('no!');
}
}
</script>
</head>
<body>
<div id="x" style="width: 160px; height: 80px; overflow:auto; padding:0; margin:0">
asdfsdfsdfasdfasdf<br />
asdfsdfsdfa sdfasdfasd fsdfsdfasdfasdf<br />
asdfsdfsdfasdfasdf<br />
asdfsdfsdfasdfasdf<br />
asdfsdfsdfasdfasdf<br />
asdfsdfsdfasdfasdf<br />
asdfsdfsdfasdfasdf<br />
asdfsdfsdfasdfasdf<br />
asdfsdfsdfasdfasdf<br />
</div>
<input type="button" onclick="foo()" value="test" />
</body>
</html>