js定时器

<!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=utf-8" />
<title>无标题文档</title>
</head>
 
<body>
<span id="test">5</span>
</body>
</html>
<script type="text/javascript" src="http://www.dcopxiolet.com/homes/Tpl/Style/js/jquery-1.js"></script>
 
<script type="text/javascript">
var messageTime = 5;
 
function messageHide()
{
	if(messageTime > 0)
	{
		messageTime--;
		$('#test').text(messageTime);
		var message = setTimeout(messageHide,1000);
	}else
	{
		alert(1);
		clearTimeout(message);
 
	}
}
messageHide();
</script>