我有一个简单的 asp:treeview
<asp:TreeView ID="TreeView1" runat="server"
ShowCheckBoxes="Leaf"
OnTreeNodeCheckChanged="CheckChanged"
ShowLines="true"
PopulateNodesFromClient="true"
ShowExpandCollapse="true"
NodeIndent="10">
</asp:TreeView>
我这样做
<script type="text/javascript">
function client_OnTreeNodeChecked(event) {
var treeNode = event.srcElement || event.target;
if (treeNode.tagName == "INPUT" && treeNode.type == "checkbox") {
if (treeNode.checked) {
alert(treeNode.value);
}
}
}
</script>
但我只会在警报中“开启”。如何获取节点的值而不是复选框的值?