Question: I have the following code which seems to work fine in all browsers except IE8 and below.

```
$("table.availability").each( function() {
    var siteName = $(this).parent().siblings("h2").contents().filter(function() { return this.nodeType == Node.TEXT_NODE; }).text()
    alert(sitename);
});

```

It gets the content of an element and strips out everything contained within a child element just leaving the text of that element.

The error I get says that `Node` is undefined - so I declare it at the top of the js file and then get the same message about `TEXT_NODE` so I declare that. I then get the following error:

`Unable to get property 'TEXT_NODE' of undefined or null reference`

Can anyone help me to fix this or can anyone think of a better way to get the same result. Thanks.

Answer: 
For IE8 and below version node does not work, changing `node` to `window` worked for me.
I'm guessing that you're structure is something like this:

```
<h2>
    text to filter
    <span>other text</span>
</h2>

```

And you're trying to filter out the "other text" inside h2?
If so - why not add another tag wrapper around the text that you need, e.g.

```
<h2>
    <span class="text-to-filter">text to filter</span>
    <span>other text</span>
</h2>

```

and do that:

```
$(this).parent().siblings("h2").find('.text-to-filter').text()

```