title: Search Nested JSON with jQuery or Javascript
body: <p>I have a large Nested JSON file which I use to bind to a treeview. I want to search this treeview datasource by text and get all the nodes that match up until its parent so I can preserve tree structure. So lets say I have a JSON like below:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>[
    {
      "x": "Root-1",
      "y": "000001",
      "c": [
        {
          "x": "child-1",
          "y": "000001.1"
        },
        {
          "x": "child-2",
          "y": "000001.2",
          "c": [
            {
              "x": "child-3",
              "y": "000001.3"
            }
          ]
        }
      ]
    },
    {
      "x": "Root-2",
      "y": "000002",
      "c": [
        {
          "x": "child-4",
          "y": "000002.1"
        },
        {
          "x": "child-5",
          "y": "000002.2",
          "c": [
            {
              "x": "child-6",
              "y": "000002.3",
              "c": [
                {
                  "x": "child-7",
                  "y": "000002.4"
                }
              ]
            }
          ]
        }
      ]
    }
  ]</code></pre>
  </div>
  </div>
  </p>
  
  <p>Now in a textbox, I want to do a contains search for: "1.3" and it should return me below objects with same nesting:</p>
  
  <p>child-3(since this matched), child-2(child-3's parent) and root-1(child-2's parent).</p>
  
  <p>Now I can use this JSON to bind to my tree-view.</p>