html页面:
<body>
<form name="form1">
<input type="text" name="title" id="title" value="黑色头发" style="font-family:Helvetica">
<select name="selector" id="selector" onchange="changeColor()">
<option value="one">红色 </option>
<option value="two">绿色 </option>
</select>
<select name="selector2" id="selector2" onchange="changeStyle()">
<option value="one">宋体 </option>
<option value="two">楷体 </option>
</select>
</form>
</body>
</html>
js改变字体颜色的方法:
<script>
function changeColor()
{
var title = document.getElementById("title").value
var select = document.getElementById("selector").value
if(select=="two")
{
document.getElementById("title").style.color="green"
}
else document.getElementById("title").style.color="red"
}