Creating a tree, is div or ul better?
I am creating my own tree implementation similar to Dojo or jQuery trees (like a file tree, complete with collapsing/expanding nodes) and I am wondering what advantages/disadvantages coding by ul and li tags would have over div tags. Most implementations that I see (Dojo for example) use divs, but I would think ul and li tags made for representing hierarchical structures would 开发者_JAVA技巧be better suited. So why the use of divs?
UL/OL/LI/DIV are all block elements but UL/OL/LI impart more semantic information.
Don't get a case of DIVitus :-) I do not know why others have this syndrome, perhaps there are some legacy iCab issues? chuckle
OL often makes "semantic sense" over UL because most trees/lists are, well, ordered.
Happy coding.
精彩评论