读书人

关于select的有关问题

发布时间: 2012-02-07 17:45:37 作者: rapoo

关于select的问题~
关于标签 <select id= "xx " name= "xx " onChange= "javascript:xx(); ">
<option class= "selectColor1 " value= "F5D6D7 " > Select Country </option>
<option class= "selectColor2 " value= "D4DFFA "> other </option>
</select>


<script language= "javascript ">
function xxfu()
{
var selects=document.getElementById( 'xx ').value;
document.getElementById( 'newId ').style.background = '# '+selects;
}
</script>

为什么改变select的时候,,,newid没有什么反映呢。。。

[解决办法]
用backgroundColor
[解决办法]
<select id= "xx " name= "xx " onchange= "xxfu() ">
<option class= "selectColor1 " value= "F5D6D7 " > Select Country </option>
<option class= "selectColor2 " value= "D4DFFA "> other </option>
</select>
<TABLE id=newId>
<TR>
<TD> 去we </TD>
<TD> </TD>
</TR>
<TR>
<TD> 去we </TD>
<TD> 去we </TD>
</TR>
</TABLE>

<script language= "javascript ">
function xxfu()
{
var selects=document.getElementById( 'xx ').value;
document.getElementById( 'newId ').style.background = '# '+selects;
}
</script>
[解决办法]
<html>

<head>

<title> </title>
<script language= "javascript ">
function xxfu()
{
var selects=document.getElementById( 'xx ').value;
document.getElementById( 'newId ').style.background = '# '+selects;
}
</script>
</head>
<body>
<select id= "xx " name= "xx " onChange= 'xxfu() '>
<option class= "selectColor1 " value= "F5D6D7 " > 请选择 </option>
<option class= "selectColor1 " value= "F5D6D7 " > Select Country </option>
<option class= "selectColor2 " value= "D4DFFA "> other </option>
</select>
<input type = 'text ' id = 'newId '>
</body>
</html>

没找到你说的 "newId " 自己加了一个text

读书人网 >JavaScript

热点推荐