<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function showhide(flag){
if(flag==0){
document.getElementById("news").style.display="none";
document.getElementById("news1").style.display="none";
document.getElementById("news2").style.display="block";
}
if(flag==1){
document.getElementById("news").style.display="block";
document.getElementById("news1").style.display="none";
document.getElementById("news2").style.display="none";
}
if(flag==2)
{
document.getElementById("news").style.display="none";
document.getElementById("news1").style.display="block"
document.getElementById("news2").style.display="none";
}
}
</script>
</head>
<body>
<select name="sex" onchange="showhide(value)">
<option value="0">请选择</option>
<option value="1">女孩</option>
<option value="2">男孩</option>
</select><br><br>
<div id="news2" style="display:block">猜猜我是谁?</div>
<div id="news" style="display:none">我是女生,漂亮的女生</div>
<div id="news1" style="display:none">我是男生,帅帅的男生</div>
</body>
</html>