//添加行function addRow(customer, cusAddr) {var tblObj = document.getElementById("tblDiv");var newRow = tblObj.insertRow(tblObj.rows.length - 2);var newColCustomer = newRow.insertCell(newRow.cells.length);var newSelect = newRow.insertCell(newRow.cells.length);newColCustomer.innerHTML = customer;newSelect.innerHTML = "<span style='cursor:hand;' onclick='showAddress(customer)'">[选择]</span>"alert(newSelect.innerHTML);}function showAddress(customer) {alert(customer);--结果是[object Object]document.getElementById("customerName").value = customer;//结果object//document.getElementById("address").value = cusAddr;alert("----------------------------------");}
3 回答
慕的地6264312
TA贡献1817条经验 获得超6个赞
<script>
function mover(obj)
{
obj.style.backgroundColor="#00ccff";
obj.style.borderWidth="2px";
obj.style.borderStyle="dashed";
}
function mout(obj)
{
obj.style.backgroundColor="White";
obj.style.borderWidth="1px";
obj.style.borderStyle="solid";
}
</script>
<span style="border-style:solid;border-width:1px;" onmouseover="mover(this)" onmouseout="mout(this)">This is a span</span>
红颜莎娜
TA贡献1842条经验 获得超12个赞
newSelect.innerHTML = "<span style='cursor:hand;' onclick='showAddress(“+customer+”)'">
这句这样改一下
慕婉清6462132
TA贡献1804条经验 获得超2个赞
newSelect.innerHTML = "<span style='cursor:hand;' onclick='showAddress(\"" + customer+"\");'">[选择]</span>"
添加回答
举报
0/150
提交
取消