display显示.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <title> New Document </title>
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">

  <script language="JavaScript">

function change(){
if(document.getElementById("selectcheck").value=='0'){
  document.getElementById("a").style.display="";
  document.getElementById("b").style.display="none";
}

if(document.getElementById("selectcheck").value=='1'){
   document.getElementById("b").style.display="";
   document.getElementById("a").style.display="none";
}
}
</script>

</head>

<body>
        <select name="selectcheck" id="selectcheck" onclick="change();">
<option value="0" selected >出现aaaaa</option>
<option value="1">出现bbb</option>
</select>

         <br><br><br><br><br><br>

        <div id="a">aaaaa</div>
 
<div id="b" style="display:none">bbb</bbb>
</body>


</html>

你可能感兴趣的:(html)