Quote:
Originally Posted by SB65
Ok, I realise I'm arguing against a number of people far more experienced than me here, but isn't hiding a field or using javascript adding unnecessary complexity?
And isn't the transitional doctype designed precisely for this sort of occurrence?
|
Well, actually no, the transitional doctype wan’t invented to resort back to non-standard code just to get a “valid” document. Its original purpose was to ease the
transition from documents coded after old, non-standard methods to a standards compliant markup. It provides a way to apply at least
something to old websites that used to have no document type definition at all so the HTML parser knows what actually to parse. For this reason a transitional doctype won’t penalize the use of deprecated elements or attributes. But the actual definition of
true valid HTML is the
strict definition.
In a nutshell: Newly created websites should
always get the strict doctype. The transitional doctype is only for already existing websites that are in the transition of old non-standard code (with no doctype) to standards compliant code.
As to the JavaScript issue: I wasn’t actually thinking of hiding a field with JavaScript but more in the way of changing the counter of the list items through JS or dynamically adding/changing the numbers with JS, skipping one value (where the CSS method wouldn’t apply).
Of course this is a little more complex than using deprecated but working attributes but on the other hand it’s a lot cleaner and more modularized (if you make use of
unobtrusive JavaScript).
However, at the end of the day it’s totally your choice what you do. You aren’t breaking any laws by writing tag soup.