1. 实例代码
JavaScript代码:
<script language="JavaScript">
function check(theForm){
if(theForm.xh.value.length!=11){
alert("学号必须为11位!");
theForm.xh.focus();
return (false);
}
var myselect = document.getElementById("bj");
var index = myselect.selectedIndex;