Subj : Redefining firstChild on prototype in firefox To : netscape.public.mozilla.jseng From : Mcginkel Date : Wed Jun 08 2005 08:44 am I am trying to change the default behaviour from firefox/mozilla to behave exactly like IE for the firstChild property of an HTMLElement. I want comment- and text-nodes with only whitespace to be skipped just like IE does. I use the following code to get this behaviour : HTMLDivElement.prototype.__defineGetter__("firstChild", function() { var node = this.childNodes[0]; while (node && (node.nodeType == 8 || ( (node.nodeType == 3) && !(/[^\t\n\r ]/.test(node.data))) )) { node = node.nextSibling; } return node; }); The code works, but I have to do this for every type of Element (HTMLDivElement, HTMLTableElement etc) while I would like to do this once on HTMLElement so all elements get this behaviour. I can do this with properties that are new (outerHTML etc), but not with existing properties in firefox/mozilla. Any ideas if this is possible ? Regards, Kees van Ginkel .