简单JavaScript问题

来源:百度知道 编辑:UC知道 时间:2024/06/06 05:07:30
点击按钮<input type="button" name="button" value="搜 索" class='input' onClick="i()">
实现function i()
{
判断下拉框year和month是否有值,有给变量i=0,没有给i=1
}

把下面代码另存为.htm就可以咯。

====================================================================

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新概念</title>
<style type="text/css">
<!--
body {
background-color: #E4EEBA;
margin-left: 0px;
margin-right: 0px;
}

-->
</style>
<script language="javascript">
function $form(){
if(document.form1.year.value=="" || document.form1.year.value==null){
return 0;
}
if(document.form1.month.value=="" || document.form1.month.value==null){
return 0;