js select
来源:互联网 发布:sql找出重复数据 编辑:程序博客网 时间:2024/06/05 23:40
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function getTest(){
var obj=document.getElementById("t1");
//alert(obj);
var index=obj.selectedIndex;
// alert(index);
var text=obj.options[index].text;
alert(text);
var value=obj.options[index].value;
alert(value);
}
</script>
</head>
<body>
<select id="t1" name="jobname" onchange="getTest();">
<option value="China">中国</option>
<option value="USA">美国</option>
<option value="English">英国</option>
</select>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function getTest(){
var obj=document.getElementById("t1");
//alert(obj);
var index=obj.selectedIndex;
// alert(index);
var text=obj.options[index].text;
alert(text);
var value=obj.options[index].value;
alert(value);
}
</script>
</head>
<body>
<select id="t1" name="jobname" onchange="getTest();">
<option value="China">中国</option>
<option value="USA">美国</option>
<option value="English">英国</option>
</select>
</body>
</html>
0 0
- js select
- js select
- js对select 操作
- js刷新select
- JS美化select运费
- js 操作select
- Js control select component
- js 操作select标签
- js操作select控件
- js操作select控件
- js 操作Select标记
- js操作select
- JS创建TD SELECT
- js 获取select值
- js操作select控件
- JS 模拟 select
- js select 排序
- js 兼容问题 SELECT OPTION
- 实习第一天
- 在进行C51程序设计时如何精确延时的常见方法介绍
- 机器学习之线性回归
- Robot Framework经验谈 -- 将已有库运行为Remote库的例子
- 自定义Application的使用 百度定位里面有个自定义application
- js select
- 架构实战—软件架构设计的过程
- linux proc目录
- 敏捷开发系列终极之旅 第六站(像橄榄球运动一样富有激情的SCRUM)
- 聚合函数
- java之父
- POJ 1125 Stockbroker Grapevine (Floyd)
- lkm 的应用 Linux VS Android
- PHP回调函数的实现方法