• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Chapter 27. List Elements

Lists have been with us since at least the days of pen and paper (which thankfully haven't gone away entirely), and are present in HTML and JavaScript as well. Literally every array in JavaScript is an ordered collection of values—which matches the definition of a list pretty well. (Arrays can have properties outside the ordered collection, but this is beside the point.)

HTML and XHTML take an interesting approach to lists (and later, tables, in Chapter 29, “Table Elements”). They have a wrapper list element (<ul>...</ul>, <ol>...</ol>), which contains exclusively a special list item element (<li>...</li>). Thus, they present a one-dimensional data structure in a hierarchy, as opposed to tables, which are two-dimensional.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint