你说到是下边这个意思吗:
<html>
<style>
</style>
<Script language="javascript">
<!--
function fncColor(){
var n = document.form1.sel.selectedIndex;
var len=document.form1.sel.options.length;
for(i=1;i<len;i++){
if (i==n){
document.form1.sel.options[i].style.color="red";
}
else{
document.form1.sel.options[i].style.color="black";
}
}}
//-->
</Script>
</head> <body>
<form name="form1">
<select name="sel" onmousemove="fncColor()">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
</select>
</form>
</body>
</html>
<html>
<style>
</style>
<Script language="javascript">
<!--
function fncColor(){
var n = document.form1.sel.selectedIndex;
var len=document.form1.sel.options.length;
for(i=1;i<len;i++){
if (i==n){
document.form1.sel.options[i].style.color="red";
}
else{
document.form1.sel.options[i].style.color="black";
}
}}
//-->
</Script>
</head> <body>
<form name="form1">
<select name="sel" onmousemove="fncColor()">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
</select>
</form>
</body>
</html>
解决方案 »
- 表单中的 this.form, 这里的this和form真正的含义是什么呢?
- javascript获取源文件的问题!!!
- 谁能帮我看看我的代码嘛??我按视频教学写的,可有问题啊!555急问!
- 梯形的区域,Y轴还和其他区域有交集,询问如何各自触发鼠标滑过和点击的时间
- 写段JS,如何使在没有任何操作5分钟后,跳转到首页??急救
- 关于 wanghr100(灰豆宝宝.net) 的“利用XMLHTTP无刷新获取数据“
- EJB和JAVABAEN有什么区别呢??
- iframe的鼠标事件问题!
- 一个技术无关的帖子,推荐一下
- JS方法在调用时,实参没有传递到形参中。
- 用javascript检测客户端IE能不能打开PDF文件,有没有安装程序如acrobat reader ?
- 搞了半天了,还是没搞定!
<html>
<style>
</style>
<Script language="javascript">
<!--
function fncColor(){
var n = document.form1.sel.selectedIndex;
var len=document.form1.sel.options.length;
for(i=0;i<len;i++){
if (i==n){
document.form1.sel.options[i].style.color="red";
}
else{
document.form1.sel.options[i].style.color="black";
}
}}
//-->
</Script>
</head> <body>
<form name="form1">
<select name="sel" onmouseover="fncColor()">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
</select>
</form>
</body>
</html>