<html>
<head>
<title></title>
<script type="text/javascript" src="
http://ajax.microsoft.com/ajax/jquery/jquery-1.4.min.js"></script>
<script type="text/javascript">
var jq = jQuery.noConflict();
jq(document).ready(function () {
jq("#btn_ok").click(function () {
if (jq("#name").val() == "" || jq("#pwd").val() == "") {
alert("用户名或密码不能为空!");
}
});
});
</script>
</head>
<body>
<div id="login">
用户名:<input id="name" type="text" />
<br />
密码:<input id="pwd" type="text" />
<br />
<input id="btn_ok" type="button" value="登录" />
</div>
</body>
</html>