A JavaScript code to create tree structure.