<style type="text/css">
.clrclass{
height:50px;
width:50px;
float:left;
margin-right:30px;
}
#text{
clear:left;
padding-top:20px;
}
.selClass{
width:100px;
}
</style>
</head>
<body>
<script type="text/javascript">
function changeColor(node)
{
var colorVal = node.style.backgroundColor;
document.getElementById("text").style.color = colorVal;
}
</script>
<div class="clrclass" id="clr1" style="background-color:#0F6" onclick="changeColor(this)"></div>
<div class="clrclass" id="clr2" style="background-color:blue" onclick="changeColor(this)"></div>
<div class="clrclass" id="clr3" style="background-color:red" onclick="changeColor(this)"></div>
<div class="te" id="text">
效果文字的撒打算<br/>
效果文字的撒打算<br/>
效果文字的撒打算<br/>
效果文字的撒打算<br/>
</div>
<hr />
<script type="text/javascript">
function changeColor2()
{
var oSelectNode = document.getElementsByName("selectColor")[0];
var color = oSelectNode.options[oSelectNode.selectedIndex].value;
document.getElementById("text").style.color = color;
}
</script>
<select name="selectColor" onchange="changeColor2()">
<option value="black">选择颜色</option>
<option value="red">红</option>
<option value="blue">蓝</option>
<option value="green">绿</option>
</select>
<select name="selectColor" onchange="changeColor3()" class="selClass">
<option value="black">选择颜色</option>
<option style="background-color:red" value="red">红</option>
<option style="background-color:blue" value="blue">蓝</option>
<option style="background-color:green" value="green">绿</option>
</select>
</body>
<script type="text/javascript">
function selectCity()
{
var collCitys = [['选择城市'],['1','2','3','4'],['11','22','33','44']
,['111','222','333','444']
,['1111','2222','3333','4444']];
var oSelNode = document.getElementById("selid");
var oSubNode = document.getElementById("subselid");
var index = oSelNode.selectedIndex;
var arrCities = collCitys[index];
oSubNode.length=0;
for(var x= 0; x<arrCities.length;x++)
{
var oOptNode = document.createElement("option");
oOptNode.innerHTML = arrCities[x];
oSubNode.appendChild(oOptNode);
}
}
</script>
<select id="selid" onchange="selectCity()">
<option>选择省市</option>
<option value="banben">版本</option>
<option>广告</option>
<option>阿三</option>
<option>谔谔</option>
</select>
<select id="subselid">
<option>选择城市</option>
</select>
</body>
<style type="text/css">
table a:link,table a:visited{
color:#03F;
text-decoration:none;
}
table a:hover{
color:#FF3;
}
</style>
<script type="text/javascript">
function addFile()
{
var oTabNode = document.getElementById("fileid");
var oTrNode = oTabNode.insertRow();
var oTdNode_file = oTrNode.insertCell();
var oTdNode_del = oTrNode.insertCell();
oTdNode_file.innerHTML = "<input type='file'/>";
oTdNode_del.innerHTML = "<img sr='1.jpg' alt='删除' onclick='deleteFile(this)'>";
}
function deleteFile(node)
{
var oTrNode = node.parentNode.parentNode;
oTrNode.parentNode.removeChild(oTrNode);
}
</script>
</head>
<body>
<table id="fileid">
<tr>
<td><a href="javascript:void(0)" onclick="addFile()">添加附件件</a></td>
</tr>
</table>
</body>