How to add non-standard attributes in a valid way
html, javascript, validation, w3c-validation
Solution
Using those attribute will produce an invalid document.
Adding those attributes later using Javascript will produce an invalid document (even if the W3C validator is unable to tell you so).
But W3C has never been against using proprietary extensions. Validation should not be a requirement. It is a way to tell you when you do not conform to the spec. W3C will not send the FBI just for an invalid page.
If you are relying on proprietary extensions to give your visitor a better experience (but not rely on it) then you are on the good path :-) Just pray (or contribute) for those to be in the next spec.
Now if it is about preventing browser context menu or selection, that's just rude! Don't do it!
Problem
Is there a way to have non-standard attributes like ``` onselectstart oncontextmenu ... ``` in a tag, and still pass validation as HTML 4.01 transitional somehow? Apart from adding the properties later on using Javascript.