I'm trying to show or hide certain
This is not valid HTML5, because the content model of
dl elements is
Zero or more groups each consisting of one or more
dtelements followed by one or more
ddelements, optionally intermixed with script-supporting elements.
dl can't contain
span, but most browsers will render it correctly.
span, I suggest using
di elements. They are invalid HTML5 too, but were valid in XHTML2.
<dl> <dt>Term</dt> <dd>Definition</dd> <di ng-if="true"> <dt>Term 2</dt> <dd>Definition 2</dd> </di> </dl>
However, the downside is that old IE won't recognize
di, so it won't apply CSS styles to them unless you use
document.createElement('di') while the document is loading.