点击按钮后 文本框变为Select下拉列表框
作者:bea
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>点击按钮后,文本框变为Select下拉列表框</title> <script type="text/javascript"> function showSelect(){ var _t = document.getElementById('t'); var _s = document.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>点击按钮后,文本框变为Select下拉列表框</title>
<script type="text/javascript">
function showSelect(){
var _t = document.getElementById('t');
var _s = document.getElementById('sel');
if( _t.style.display == ''){
_t.style.display = 'none';
}
else{
_t.style.display = '';
}
if ( _s.style.display == 'none' ){
_s.style.display = '';
}
else{
_s.style.display = 'none';
}
}
</script>
</head>
<body>
<input type="text" name="t" id="t" value="ASP">
<select name="sel" id="sel" style="display:none;">
<option value="0">ASP</option>
<option value="1">ASP.NET</option>
<option value="2">PHP</option>
<option value="3">JAVA</option>
</select>
<input type="submit" name="Submit" onclick="showSelect();" value="你擅长的" />
</body>
</html>
[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行]
有用 | 无用
猜你喜欢
您可能感兴趣的文章:
- 学习ExtJS(一) 之基础前提
- JavaScript 控制文本框的值连续加减
- 兼容多浏览器的JS 浮动广告[推荐]
- CSS 布局一个漂亮的滑块
- CSS 美化表格边框为凹陷立体效果的实现方法
- JavaScript 接收键盘指令示例
- JavaScript 浮点数运算 精度问题
- 面向对象的javascript(笔记)
- js removeChild 障眼法 可能出现的错误
- 学习JS面向对象成果 借国庆发布个最新作品与大家交流
- JQuery与Ajax常用代码实现对比
- Jquery 设置标题的自动翻转
- jQuery animate效果演示
- JavaScript CSS 通用循环滚动条
- 签名框(Textarea)限制文字数量并适时提示
- 点击下载链接 弹出页面实现代码
- 点击文章内容处弹出页面代码
- js类的静态属性和实例属性的理解
- XmlUtils JS操作XML工具类