This isn't a contradiction: one is talking about performance, the other is talking about maintainability. You definitely shouldn't embed HTML into your JavaScript code - that's absolutely true. That doesn't mean you can use innerHTML, though, it just means you shouldn't keep your HTML in the JavaScript where you're using innerHTML. So instead of this:
Code:
element.innerHTML = "<p>Hello world!</p>";
You would read the HTML string from somewhere else (perhaps via an Ajax call), store it in a variable, and do this:
Code:
element.innerHTML = codeToAdd;