{{APIExample|
|height=300
|desc=Transforms the unordered list with id "navigation" into a treeview, starting with all branches collapsed, and allowing only one branch open at a time. The tree state is persisted by matching the current location.
|code=try{$("#navigation").treeview({
persist: "location",
collapsed: true,
unique: true
});}catch(e){alert(e);}
|html=
}}
{{APIExample|
|height=300
|desc=Finds all div elements within an XML document from an AJAX response.
|code= $("#red").treeview({
animated: "fast",
collapsed: true,
control: "#treecontrol",
persist: "cookie",
toggle: function() {
$("#log").append("