javascript - Javascript - 選擇時,試圖顯示不同的HTML段落

  显示原文与译文双语对照的内容

我有一個模式,它應該提供一個不同的描述性段落,這取決於用戶從下拉列表中做出的選擇,目前它只顯示所有段落,選中Public時顯示'',選中'隱藏2'時顯示'',等等等等。


<html> 


<head> 


<script type="text/javascript">



 function CheckSelect(val){


 var PUBLIC=document.getElementById('Hide');


 var INTERNAL=document.getElementById('Hide2');


 var CONFIDENTIAL=document.getElementById('Hide3');


 var SECRET=document.getElementById('Hide4');



 if(val=='PUBLIC')


 PUBLIC.style.display='block';


 else if (val=='INTERNAL')


 INTERNAL.style.display='block';


 else if (val=='CONFIDENTIAL')


 CONFIDENTIAL.style.display='block';


 else if (val=='SECRET')


 SECRET.style.display='block';


 else 


 PUBLIC.style.display='none';



}



</script> 


</head>


<body>


<select id="selectDocumentType" name="documentClass" onchange='CheckSelect(this.value);'>


 <option value="Choose">Choose a classification!</option>


 <option value="PUBLIC">Public</option>


 <option value="INTERNAL">Internal</option>


 <option value="CONFIDENTIAL">Confidential</option>


 <option value="SECRET">Secret</option>


 </select>


<p align="justify" style="font-family:helvetica,garamond,serif;font-size:12px;font-style:regular;" class="light"


 id="Hide" style='display:none;'>Wizard Is working</p>


<p align="justify" style="font-family:helvetica,garamond,serif;font-size:12px;font-style:regular;" class="light"


 id="Hide2" style='display:none;'>Wizard Is Twerking</p> 


<p align="justify" style="font-family:helvetica,garamond,serif;font-size:12px;font-style:regular;" class="light"


 id="Hide3" style='display:none;'>Wizard Is Laughing</p>


<p align="justify" style="font-family:helvetica,garamond,serif;font-size:12px;font-style:regular;" class="light"


 id="Hide4" style='display:none;'>Wizard Is Eating</p> 


</body>

时间:

我有一個模式,它應該提供一個不同的描述性段落,這取決於用戶從下拉列表中做出的選擇,目前它只顯示所有段落,選中Public時顯示'',選中'隱藏2'時顯示'',等等等等。


<html> 


<head> 


<script type="text/javascript">



 function CheckSelect(val){


 var PUBLIC=document.getElementById('Hide');


 var INTERNAL=document.getElementById('Hide2');


 var CONFIDENTIAL=document.getElementById('Hide3');


 var SECRET=document.getElementById('Hide4');



 if(val=='PUBLIC')


 PUBLIC.style.display='block';


 else if (val=='INTERNAL')


 INTERNAL.style.display='block';


 else if (val=='CONFIDENTIAL')


 CONFIDENTIAL.style.display='block';


 else if (val=='SECRET')


 SECRET.style.display='block';


 else 


 PUBLIC.style.display='none';



}



</script> 


</head>


<body>


<select id="selectDocumentType" name="documentClass" onchange='CheckSelect(this.value);'>


 <option value="Choose">Choose a classification!</option>


 <option value="PUBLIC">Public</option>


 <option value="INTERNAL">Internal</option>


 <option value="CONFIDENTIAL">Confidential</option>


 <option value="SECRET">Secret</option>


 </select>


<p align="justify" style="font-family:helvetica,garamond,serif;font-size:12px;font-style:regular;" class="light"


 id="Hide" style='display:none;'>Wizard Is working</p>


<p align="justify" style="font-family:helvetica,garamond,serif;font-size:12px;font-style:regular;" class="light"


 id="Hide2" style='display:none;'>Wizard Is Twerking</p> 


<p align="justify" style="font-family:helvetica,garamond,serif;font-size:12px;font-style:regular;" class="light"


 id="Hide3" style='display:none;'>Wizard Is Laughing</p>


<p align="justify" style="font-family:helvetica,garamond,serif;font-size:12px;font-style:regular;" class="light"


 id="Hide4" style='display:none;'>Wizard Is Eating</p> 


</body>

我有一個模式,它應該提供一個不同的描述性段落,這取決於用戶從下拉列表中做出的選擇,目前它只顯示所有段落,選中Public時顯示'',選中'隱藏2'時顯示'',等等等等。


<html> 


<head> 


<script type="text/javascript">



 function CheckSelect(val){


 var PUBLIC=document.getElementById('Hide');


 var INTERNAL=document.getElementById('Hide2');


 var CONFIDENTIAL=document.getElementById('Hide3');


 var SECRET=document.getElementById('Hide4');



 if(val=='PUBLIC')


 PUBLIC.style.display='block';


 else if (val=='INTERNAL')


 INTERNAL.style.display='block';


 else if (val=='CONFIDENTIAL')


 CONFIDENTIAL.style.display='block';


 else if (val=='SECRET')


 SECRET.style.display='block';


 else 


 PUBLIC.style.display='none';



}



</script> 


</head>


<body>


<select id="selectDocumentType" name="documentClass" onchange='CheckSelect(this.value);'>


 <option value="Choose">Choose a classification!</option>


 <option value="PUBLIC">Public</option>


 <option value="INTERNAL">Internal</option>


 <option value="CONFIDENTIAL">Confidential</option>


 <option value="SECRET">Secret</option>


 </select>


<p align="justify" style="font-family:helvetica,garamond,serif;font-size:12px;font-style:regular;" class="light"


 id="Hide" style='display:none;'>Wizard Is working</p>


<p align="justify" style="font-family:helvetica,garamond,serif;font-size:12px;font-style:regular;" class="light"


 id="Hide2" style='display:none;'>Wizard Is Twerking</p> 


<p align="justify" style="font-family:helvetica,garamond,serif;font-size:12px;font-style:regular;" class="light"


 id="Hide3" style='display:none;'>Wizard Is Laughing</p>


<p align="justify" style="font-family:helvetica,garamond,serif;font-size:12px;font-style:regular;" class="light"


 id="Hide4" style='display:none;'>Wizard Is Eating</p> 


</body>

...