Sportica   Sportica

JQuery 改指定的内容 设置隐藏内容为可见



<script type="text/javascript" src="./js/jquery-1.2.2.pack.js" ></script>



function judge() //判断idstream_number里的值。然后根据这个值设置div里的内容是否显示。
{
var stream_number_value=document.getElementById("stream_number").value;
if(stream_number_value==0)
{

$('#stream_judge2').css("display","none");
$('#stream_judge3').css("display","none");
$('#stream_judge4').css("display","none");
}
if(stream_number_value==1)
{

$('#stream_judge2').css("display","");
$('#stream_judge3').css("display","none");
$('#stream_judge4').css("display","none");
}

}




<td>
<select name = "stream_number" id="stream_number" style="width:100" onchange="judge()">
<option value = "0" selected="">1</option>
<option value = "1">2</option>
<option value = "2">3</option>
<option value = "3">4</option>
</select>


//被设置的div
<div id="stream_judge2" name="stream_judge2" style="display:none">
<fieldset>
</fieldset>
</div>


posted @ 2011-12-30 17:18  qingjoin  阅读(5883)  评论(0编辑  收藏  举报
  Sportica