Of course, there are a whole range of possible errors relating to document validity, but my immediate stumbling block occurs when changing a paragraph (p
) into an address
element. My current method is (more-or-less):
var p = $('p#test');
p.replaceWith('<address>' + p.html() + '</address>');
but that fails for this specific case; it works perfectly for p -> blockquote or h2 -> h3. Firebug suggests that a self-closing element (<address/>
) has been added to the document, for some reason.
Can anyone spot the bug or suggest an alternative method?