Hence, I think we should change our coding conventions
to always use `$(
'<div />' )`.
+1 for valid XHTML. Considering that bytes are cheap and validity is
good, this seems like a good idea.
I also tried to get an answer about the better between $( '<div
class="a-class" />' ) and $( '<div />' ).addClass(
'a-class' ), but
apparently there's little difference. At least when creating dynamic
interfaces, I'd like to have some guidance and consistency if anyone is
interested in chatting about it.
My preference is the latter, because it avoids extensive HTML inside of
JavaScript. But I'd be interested to hear other thoughts.
--
Mark Holmquist
Contractor, Wikimedia Foundation
mtraceur(a)member.fsf.org
http://marktraceur.info