jquery .text() returns html tags, how can I fix this?
EDIT: I am using Firefox 3.1+ specifically, as this is an intranet application.

I have the following html:

    <em id="work-resize">re-size: from <span id="work-resize-from">3</span> to <span id="work-resize-to">5</span></em>

Using jQuery I want to get the following string:
     
    're-size: from 3 to 5'

I assumed that using `.text()` would do exactly that, however:

    $('#work-resize').text();

returns:

    're-size: from <span id="work-resize-from">3</span> to <span id="work-resize-to">5</span>'

I peaked around, and I couldn't find out why. I could use a function as suggested here [http://stackoverflow.com/questions/2174884/remove-tags-which-javascript-returns-with-the-text][1], but I really thought that the point of `.text()` was to strip out the tags, so it seems redundant to use my own function. Does anyone out there have a better solution, or suggestion if I am doing something wrong?


  [1]: http://stackoverflow.com/questions/2174884/remove-tags-which-javascript-returns-with-the-text
jquery .text() returns html tags, how can I fix this?
===

EDIT: I am using Firefox 3.1+ specifically, as this is an intranet application.

I have the following html:

    <em id="work-resize">re-size: from <span id="work-resize-from">3</span> to <span id="work-resize-to">5</span></em>

Using jQuery I want to get the following string:
     
    're-size: from 3 to 5'

I assumed that using `.text()` would do exactly that, however:

    $('#work-resize').text();

returns:

    're-size: from <span id="work-resize-from">3</span> to <span id="work-resize-to">5</span>'

I peaked around, and I couldn't find out why. I could use a function as suggested here [http://stackoverflow.com/questions/2174884/remove-tags-which-javascript-returns-with-the-text][1], but I really thought that the point of `.text()` was to strip out the tags, so it seems redundant to use my own function. Does anyone out there have a better solution, or suggestion if I am doing something wrong?


  [1]: http://stackoverflow.com/questions/2174884/remove-tags-which-javascript-returns-with-the-text