
在一个表单里能根据单选按纽选择的不同将下面的下拉框里的选项做相应变化吗
比如说我选了二手房搜索下面的价格是....元而选了出租房下面的价格是....元/月可以实现吗?高手赐教感激不尽...
比如说
我选了二手房搜索 下面的价格是....元
而选了出租房 下面的价格是....元/月
可以实现吗?
高手赐教
感激不尽 展开
我选了二手房搜索 下面的价格是....元
而选了出租房 下面的价格是....元/月
可以实现吗?
高手赐教
感激不尽 展开
1个回答
展开全部
<script>
function change_unit(obj){
if (obj.selectedIndex==0){
document.getElementById("unit").innerText="元";
}
else if (obj.selectedIndex==1){
document.getElementById("unit").innerText="元/月";
}
}
</script>
<form name=search id=search>
<select id=select_1 onchange="change_unit(this)">
<option value=0>二手房</option>
<option value=1>租房</option>
</select>
<font id=unit>元</font>
</form>
function change_unit(obj){
if (obj.selectedIndex==0){
document.getElementById("unit").innerText="元";
}
else if (obj.selectedIndex==1){
document.getElementById("unit").innerText="元/月";
}
}
</script>
<form name=search id=search>
<select id=select_1 onchange="change_unit(this)">
<option value=0>二手房</option>
<option value=1>租房</option>
</select>
<font id=unit>元</font>
</form>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询