日期:2014-05-16 浏览次数:20410 次
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<select id="sex" name="sex" checked="3" size="1">
<option value="1">body</option>
<option value="2">girl</option>
<option value="3">other</option>
</select>
<script type="text/javascript">
var sexE=document.getElementById('sex');
var sexCurrent_Option=sexE.getAttribute('checked');
var sexOptions=sexE.getElementsByTagName('option');
for(var i=0;i<sexOptions.length;i++){
if(sexOptions[i].value == sexCurrent_Option) sexOptions[i].selected="selected";
}
</script>
</body>
</html>