title: MVC treeview click event
body: <p>I am really new to the MVC/jQuery world and having trouble getting the full picture how to set up and handle a treeview click event to pass the full path (Parent &amp; Children) values to a MVC Controller in the treeview below. Example: If I click on Houston. I would like to get the parent path USA,Texas,Houston and then pass to a Controller. If just Texas, then I want USA,Texas. I am using the jstree.com tree view. Thank you for the help.</p>
  
  <p>P.S. In the console log it's say: Uncaught TypeError: Cannot read property 'value' of undefined</p>
  
  <pre><code>&lt;div id="divtree"&gt;
              &lt;ul id="tree" &gt;
                  &lt;li&gt;
                      &lt;a href="#"&gt;Locations&lt;/a&gt;
                      &lt;ul&gt;
                          &lt;li onclick="selectNode(event, this);" &gt;
                              &lt;a href="#"&gt;Texas&lt;/a&gt;
                              &lt;ul&gt;
                                  &lt;li onclick="selectNode(event, this);" &gt;
                                      &lt;a href="#"&gt;Houston&lt;/a&gt;
                                      &lt;ul&gt;
                                          &lt;li onclick="selectNode(event, this);" &gt;
                                              &lt;a href="#"&gt;Katy&lt;/a&gt;
                                          &lt;/li&gt;
                                      &lt;/ul&gt;
                                      &lt;ul&gt;
                                          &lt;li onclick="selectNode(event, this);" &gt;
                                              &lt;a href="#"&gt;Spring&lt;/a&gt;
                                          &lt;/li&gt;
                                      &lt;/ul&gt;
  
                                      &lt;script type="text/javascript"&gt;
                                          function selectNode(event, nodeHtmlEl) {
                                              console.log("selectNode Info: " + $(nodeHtmlEl).attr("li").value);
                                          }
                                      &lt;/script&gt;
                                  &lt;/li&gt;
                              &lt;/ul&gt;
  
                              &lt;script type="text/javascript"&gt;
                                  function selectNode(event, nodeHtmlEl) {
                                      console.log("selectNode Info: " + $(nodeHtmlEl).attr("li").value);
                                  }
                              &lt;/script&gt;
                          &lt;/li&gt;
                      &lt;/ul&gt;
  
                      &lt;script type="text/javascript"&gt;
                          function selectNode(event, nodeHtmlEl) {
                              console.log("selectNode Info: " + $(nodeHtmlEl).attr("li").value);
                          }
                      &lt;/script&gt;
                  &lt;/li&gt;
              &lt;/ul&gt;
          &lt;/div&gt;
  </code></pre>