[jQuery] XHTML or HTML when creating elements?
According to the jQuery documentation we're
supposed to write like this:
and not like this:
That means using XHTML style code for the
Are we supposed to do that even when we are using
HTML style code (e.g. HTML 4.01)?
$('#whatever').html('<img alt="" src="..." />');
That would seem a bit bizarre if the actual HTML
page has lots of '<img alt="" src="">' without the
It does seem that "img", "br" etc. work without the
ending slash as well.
Bertilo Wennergren <http://bertilow.com>