我使用 javascript 制作了一个组合框,该组合框从 html 文件本身获取值,下面是组合框的代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>pro-v0</title>
<style type="text/css" media="screen">
div.combobox {font-family: Tahoma;font-size: 12px}
div.combobox {position: relative;zoom: 1}
div.combobox div.dropdownlist {display: none;width: 200px;
border: solid 1px #000;background-color: #fff;
height: 200px;overflow: auto;position: absolute;
top: 18px;left: 0px;}
div.combobox .dropdownlist a {display: block;text-decoration: none;
color: #000;padding: 1px;height: 1em;cursor: default}
div.combobox .dropdownlist a.light {color: #fff;
background-color: #007}
div.combobox .dropdownlist, input {font-family: Tahoma;font-size: 12px;}
div.combobox input {float: left;width: 182px;
border: solid 1px #ccc;height: 15px}
div.combobox span {border: solid 1px #ccc;background: #eee;
width: 16px;height: 17px;
float: left;text-align: center;border-left: none;cursor: default}
</style>
</head>
<body>
<div class="combobox">
<input type="text" name="comboboxfieldname" id="cb_identifier">
<span>V</span>
<div class="dropdownlist">
<a>option 1</a>
<a>option 2</a>
<a>option 3</a>
<a>option 4</a>
</div>
</div>
<script type="text/javascript" charset="utf-8" src="https://raw.github.com/RUPOJS/jsCombo/master/combobox.js"></script>
<script type="text/javascript" charset="utf-8">
var no = new inputSelect('cb_identifier');
</script>
</body>
</html>
现在,如何从 javascript 文件或其他文件中获取值或如何创建
使用 javascript 包含所有值的下拉列表 div。提前致谢。