HTML中有个下拉框,包含“风,雨,雷,电”,添加事件,当选择风时,文本域内出现选择
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<form name="form_name" >
<select name="select_name" onChange="ShowToText(); " >
<option value="1">风</option>
<option value="2">雨</option>
<option value="3">雷</option>
<option value="4">电</option>
</select><br>
<textarea rows="3" cols="30"name="textfield_name3">
</textarea>
</form>
</body>
<script language="JavaScript">
function ShowToText(){
document.form_name.textfield_name3.value=document.form_name.select_name.options[document.form_name.select_name.selectedIndex].text
}
</script>
</html> 运行效果
相信看了这些案例你已经掌握了方法,更多精彩请关注Gxl网其它相关文章!
相关阅读:
HTML里关于表格table嵌套的注意事项
HTML5标签嵌套规则的详细介绍
html5制作吃月饼小游戏教程
以上就是用H5做有特效的下拉框的详细内容,更多请关注Gxl网其它相关文章!
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did71823