I’m looking for the most semantically correct and sane method of marking up an ordered definition list. I have thought about hte following ways of doing it.
First I used an ordered list with 2 paragraphs within each list item. But then I remembered the definition list element.
<dl>
<dt>Something</dt>
<dd>Definition</dd>
<dt>Something2</dt>
<dd>Definition2</dd>
</dl>
However as I need to be able to access each definition programmatically through Javascript I’m not sure that this would work.
The solution to this might be to separate the definitions into different dl tags. But that doesn’t look very good at all. Is there a more correct way? Or am I incorrect in assuming that is more complicated to access the “normal” definition list through Javascript?
<dl>
<dt>Something</dt>
<dd>Definition</dd>
</dl>
<dl>
<dt>Something2</dt>
<dd>Definition2</dd>
</dl>
Just get each definition term
<dt>and then get the element next to it in the DOM tree, which should always be the definition description<dd>. jQuery is of great help in here. Here’s an SSCCE, just copy’n’paste’n’run it: