Payal Nair

Payal Nair

  • NA
  • 79
  • 0

Finding if a child node exists under a treenode in TreeView

Nov 24 2016 5:36 AM
I need to access child nodes of the selected node using javascript. I was able to achieve till here -retrieving the selected node.
 
 
var treeViewData = window["<%=FileTreeView.ClientID%>" + "_Data"];
if (treeViewData.selectedNodeID.value != "") {
var selectedNode = document.getElementById(treeViewData.selectedNodeID.value);
var text = selectedNode.innerHTML;
 
Next I need to iterate through the child nodes of selected node. I have tried with selectedNode.childNodes,selectedNode.children which returns either 0 or 1 which is not true in my case. Please help.
Divya


Answers (1)