日期:2014-05-20  浏览次数:20402 次

如何使用javascript得到TreeView当前选中的节点
谢谢大虾们

------解决方案--------------------
function client_OnTreeNodeChecked(event)
{
var TreeNode = event.srcElement || event.target ;
//这是加CheckBox的,改成TreeNode.type == "img "
if (TreeNode.tagName == "INPUT " && TreeNode.type == "checkbox ")
{
if(TreeNode.checked)
{
var checkTitle = TreeNode.title;
alert(checkTitle);
}
}
}


<asp:TreeView ID= "treeWebSite " runat= "server " ExpandDepth= "0 " onclick= "client_OnTreeNodeChecked(event); " >
</asp:TreeView>