[求助]请教一个JavaScript问题
请问我这样才能得到加进去的商品的值<html>
<head>
<title>dyment.html</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<script language="javascript">
function addsort(){
var name = document.getElementById("name").value;
if(name==""){
return;
}
var row = document.createElement("tr");
row.setAttribute("id",name);
var cell = document.createElement("td");
cell.appendChild(document.createTextNode(name));
row.appendChild(cell);
var tt = document.createElement("input");
tt.setAttribute("type","button");
tt.setAttribute("value","修改");
tt.onclick = function (){rework(name);};
cell = document.createElement("td");
cell.appendChild(tt);
row.appendChild(cell);
document.getElementById("sortList").appendChild(row);
document.getElementById("name").value="";
}
function rework(id){
if(id!=null){
var df = document.getElementById(id);
window.alert("怎样得到品牌名称");/**8我怎样才能得到加进去的商品的值****/
}}
</script>
<body>
增加商品:<input id="name" type="text">
<input type="button" value="确定" onclick="addsort()">
<table border="1" width="400">
<tr>
<td height="20" valign="top" align="center">
品牌名称:
</td>
<td id="pos_2" height="20">
修改
</td>
</tr>
<tbody id="sortList"></tbody>
</table>
</body>
</html>