日期:2014-05-16 浏览次数:20522 次
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function check(form){
alert("[" + form.age.value + "]");// [ ]
alert(typeof(form.age.value));//string
alert(form.age.value==" ");//IE ture, firefox/chrome> false
return false;
}
</script>
</head>
<body>
<form onsubmit="check(this);" method="post" action="#">
<select name="age">
<option> </option>
<option value="18">18</option>
</select>
<input type="submit" value="submit" />
</form>
</body>
</html>