Get text of the node
<p>In an ASP.NET application I have a IreeView.</p>

<p>Here is one of the nodes in the view:</p>



<pre><code>&lt;td style="white-space: nowrap;"&gt;
&lt;input id="TreeView1n10CheckBox" type="checkbox" checked="checked" name="TreeView1n10CheckBox"&gt;
&lt;a id="TreeView1t10" onclick="TreeView_SelectNode(TreeView1_Data, this,'TreeView1t10');" href="javascript:__doPostBack('TreeView1','sPreAnalytical\\Test Requisitions\\2 Specimens: 1 Req')" class="TreeView1_0"&gt;2 Specimens: 1 Req&lt;/a&gt;
</code></pre>

<p>As you can see it is a checkbox and there is text after it <code>'TreeView1','sPreAnalytical\\Test Requisitions\\2 Specimens: 1 Req'</code></p>

<p>How do I get the text <code>2 Specimens: 1 Req'</code> on the client side, and how do I modify this text using JavaScript and display the modified TreeView to the client?</p>

<p>this works beautifully:</p>

<pre><code>function check_OnTreeNodeChecked(event) {
                  var TreeNode = event.srcElement || event.target;
                  if (TreeNode.tagName == "INPUT" &amp;&amp; TreeNode.type == "checkbox") {
                      if (TreeNode.checked) {
                          var elNode = document.getElementById("TreeView1t10");
                          var sText = elNode.innerText || elNode.innerHTML;

                          alert(sText);
                          elNode.innerHTML = "Whatever you want";
                      }
                  }

              } 
</code></pre>

<p>however since i need to modify the specific text next to the checkbox i need to be able to know which element id it was instead of implicitly specifying <code>var elNode = document.getElementById("TreeView1t10");</code></p>

<p><strong>Question</strong> how do i get the element id of the box that was checked?</p>
