Most style guidelines for most programming languages recommend a maximum line length, typically 80 characters. This seems impractically short for HTML and JavaScript (when it is embedded in HTML). Is there a consensus on a practical line length limit for HTML/JavaScript? Or is it generally left up to the developer's common sense?
The maximum limit on line length is whatever you feel comfortable reading and editing. personally, any code of mine that won't fit on the screen without wrapping will be rewritten.
The 80 character line limit spawns from the days of screens without a lot of real estate. Now it's just like that for readability, and so it's possible to have two (or more) different code files opened side-by-side, without having to scroll to see each of them.
Those reasons still apply to HTML and JavaScript, although, it's obviously not necessary to comply with them. So it's up to you.
I agree that with HTML it can be difficult to keep within that limit, although with JavaScript it shouldn't be a problem.
Since you mention JavaScript, this is what Douglas Crockford has to say on the topic:
Avoid lines longer than 80 characters. When a statement will not fit on a single line, it may be necessary to break it. Place the break after an operator, ideally after a comma. A break after an operator decreases the likelihood that a copy-paste error will be masked by semicolon insertion. The next line should be indented 8 spaces.
From: Code Conventions for the JavaScript Programming Language