Say you have an element named
Different browsers answer this question in a different ways. All browsers except IE (<IE9) inherit unknown elements properties and let the programmer define styling on it. IE not allows unknown element styling.
What DOM element should be created for “unknown” element?
IE (<IE9) insert the element into the DOM as an empty leaf element. All elements inside the unknown that you would expect to be its children will be inserted as siblings.
IE (<IE9) solution:
Create “dummy” element: document.createElement(“myprivateelement”);
Note that we do not insert it into the DOM, only creating it. This way IE will recognize and allow its styling.
By the way... this is the way HTML5 patches install the new HTML5 features for you to use.
No comments:
Post a Comment