New dialog window does not replace id="???" of old dialog window.

New dialog window does not replace id="???" of old dialog window.

Let's say I open a dialog window with a text box in it that has the id "myTextBox." I then type "test" in this text box. I'll then close the dialog window using .dialog("close").dialog('remove');

If I open a new dialog window (same page), then type in "new test" in the text box, jQuery will report "test" when I call $('#myTextBox').val(). The new text box, with the same ID is duplicated and jQuery can't find this new object.

Is the old content not cleared for some reason? Any help is appreciated.