点击按钮后 文本框变为Select下拉列表框

| |
14:33,10,Jan,2012 | (538/1/0) | 源码天空
点击在新窗口中浏览此图片


<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>

2012/02/06 19:27 #1bestkaola Email Homepage
欢迎回访!
分页: 1/1 第一页 1 最后页
发表评论
  • 昵称 [注册]
  • 密码 游客无需密码
  • 网址
  • 电邮
打开HTML 打开UBB 打开表情 隐藏 记住我