#field is: <span id="field">$ 25.00</span>
On Feb 19, 5:04 pm, "Richard D. Worth" <rdwo...@gmail.com> wrote: > Is #field a text input? Perhaps you want .val() instead of .text() ? > > - Richard > > On Thu, Feb 19, 2009 at 8:56 AM, major <mei...@gmail.com> wrote: > > > assume the following code: > > -------------------------------------- > > price = $("#field").text(); > > -------------------------------------- > > This code cause the following error in IE: "object doesn't support > > this property or method". > > $("#field").text(); returns a string, like: "$21.3". (the data is > > price). > > I guess the $ character (of "$21.3") make JQuery confused as it thinks > > this is a function. > > BUT, when I write something like this: > > var htmlOut = '<span>' + $("#field").text(); + '</span>' > > No error occurs! > > What may cause this bug in IE to happen? > > Thanks,Major