x3dom/x3dom — Issue #76: getElementById in Firefox by inlines in Html
Author: annakasia79
Created: 2012-01-26 14:58:11+00:00
State: open
Labels: bug

Firefox don´t implement getElementById() by XML documents:
https://developer.mozilla.org/en/xml/xml%3Aid

It follows that the inlines they are reflected at html don't wrok getElementById.

You must use either xhtml or a work around like:

Array.forEach ( document.getElementsByTagName('material'), function (material) {
if(material.getAttribute('id') == 'test__color') {
material.setAttribute('diffuseColor', 'blue');
}
} );

instead of

document.getElementById('test__color').setAttribute('diffuseColor', 'blue');