<!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>
<title> new document </title>
</head>
<script>
function show(){
var obj = document.getElementById("sel1");
document.getElementById("input1").value = obj.options[obj.selectedIndex].text;
document.getElementById("input1").focus();
}
function edit(){
var obj = document.getElementById("sel1");
obj.options[obj.selectedIndex].text = document.getElementById("input1").value;
}
</script>
<body>
<select id="sel1" multiple="multiple" onchange="show()" style="width:100px">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
<input type="text" id="input1" />
<input type="button" value="修改" onclick="edit()" />
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
</head>
<script>
function show(){
var obj = document.getElementById("sel1");
document.getElementById("input1").value = obj.options[obj.selectedIndex].text;
document.getElementById("input1").focus();
}
function edit(){
var obj = document.getElementById("sel1");
obj.options[obj.selectedIndex].text = document.getElementById("input1").value;
}
</script>
<body>
<select id="sel1" multiple="multiple" onchange="show()" style="width:100px">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
<input type="text" id="input1" />
<input type="button" value="修改" onclick="edit()" />
</body>
</html>
是直接在select里面编辑option
不知道有没有这个功能,上次看到的也许是模拟的。
不过是直接模拟SELECT标签
还是只是弹出一个层在SELECT标签上呢