tags:

views:

23

answers:

2

There are certain guide lines to be followed while writing Html for you page.

my question is what if we dont follow those rules. Iam asking this because my site heavily work with javascript for dom manipulation and there are certain points where we have to add custom attributes.

I want to know what problems i may face by not following guidelines.

+1  A: 

Different browsers will treat invalid markup in different ways. Custom attributes, though, are universally ignored AFAIK.

It's still best to test your markup in as many clients as possible to ensure it works as expected.

King Isaac
+1  A: 

A lot a well-accepted libraries (JQuery comes to mind, but I doubt it's the only one) add "invalid" attributes through direct DOM manipulation. No one seems to care, even fierce advocates of valid content, and browsers will usually ignore unrecognized attributes (tags get a different treatment).

When it comes to best practices, I'd advise you prefix your nonstandard attributes with a proprietary prefix, to avoid any conflict in potential future revision of the standards.

Xr