<!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>
<title>测试</title>
<script src="js/jquery-1.5.2.min.js" type="text/javascript"></script>
<script type="text/ecmascript">
$(function () {
$("#btn").click(function () {
if ($("#text1").text=="") {
alert("内容不能为空");
}
});
});
</script>
</head>
<body>
<input type="text" id="text1" />
<input type="button" value="确定" id="btn"/>
</body>
</html>
if ($("#text1").text()=="") {
}
楼上说的极是
恩恩!