请教大师们,listbox 点击节点后,选中的值在另一个txt中出现应该怎么搞

来源:百度知道 编辑:UC知道 时间:2024/05/24 10:10:23
请教大师们,listbox 点击节点后,选中的值在另一个txt中出现应该怎么搞

//后台
ListBox1.Attributes.Add("onclick", "Test(this)");
//前台JS
function Test(obj)
{
var m = obj.options[obj.selectedIndex].innerText;
document.getElementById("txtShow").value = m;
}

this.txt.Text = this.listbox.SelectedValue;