Accepted answer

You don't need to put them all into one array, if you want to search them separately. I'm not familiar with d3, but wouldn't a simple for loop like this do the trick; where currentObject is the chunk of JSON you want to search:

var searchedId = document.getElementById("search").value;
for (var i=0; i<currentObject.nodes.length; i++) {
    var node = currentObject.nodes[i];
    if ( == searchedId) {
        // display node

Related Query

More Query from same tag