function ExtractBookmark(Bm, isRoot) { // write a name of the bookmark var Title = ""; if (isRoot == false) { Title += Bm.name; } // process children if (Bm.children != null) { for (var i = 0; i < Bm.children.length; i++) { if (!(Title === "")) Title += "; " Title += ExtractBookmark(Bm.children[i], false); } } return Title; } var root = this.bookmarkRoot; event.value = ExtractBookmark(root, true);