posts - 66,  comments - 40,  trackbacks - 0
1  检测是否有选中
 2 if (objSelect.selectedIndex  >   - 1 {
 3 // 说明选中
 4 }
  else   {
 5 // 说明没有选中
 6 }

 7
 8 2  删除被选中的项 
 9 objSelect.options[objSelect.selectedIndex]  =   null ;
10
11 3  增加项
12 objSelect.options[objSelect.length]  =   new  Option( " 你好 " , " hello " );
13
14 4  修改所选择中的项
15 objSelect.options[objSelect.selectedIndex]  =   new  Option( " 你好 " , " hello " );
16
17 5  得到所选择项的文本
18 objSelect.options[objSelect.selectedIndex].text;
19
20 6  得到所选择项的值
21 objSelect.options[objSelect.selectedIndex].value;
posted on 2006-12-31 14:58 happytian 阅读(181) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航:
 
<2006年12月>
262728293012
3456789
10111213141516
17181920212223
24252627282930
31123456

Welcome here, my friend!

常用链接

留言簿(12)

随笔档案(66)

文章分类

文章档案(63)

web

最新随笔

搜索

  •  

积分与排名

  • 积分 - 87866
  • 排名 - 645

最新评论

阅读排行榜

评论排行榜