Hi,
I thank you all for your help. I guess I'll go with Bohdan's suggestion. I'll put the text inside another tag (probably p tag...). thanks again for all your help, if you think of anything else please let me know. Kazuar Bohdan Ganicky wrote: > > > Hello, > > maybe it could be easier to use the good old DOM in this scenario: > > var textNode = $('#testText').get().firstChild; // now we have the > textNode > var textRaw = textNode.nodeValue; // now we have the text string with > all the white-space around > var text = $.trim(textRaw); // we strip the trailing white-space using > the jQuery trim function > > Of course this works as expected only if the text you're looking for > is placed in the #testText's first textNode. > > I'd recommend using more meaningful markup instead and putting the > text inside <p> element. ;) > > -- > Bohdan Ganicky > > On Jan 12, 11:55 am, kazuar <kazuar...@gmail.com> wrote: >> hello, Im kinda new in jquery so maybe its a begginer question. >> I have a page with a div containing some text and a combobox. >> something like that >> >> <div id="testText"> >> hello this is text and this is combobox >> <select><option value='1'>1</option><option value='2'>2</option><option >> value='3'>3</option></select></div> >> >> I wrote a function which return the text from the div. >> >> alert($('#testText').text()); >> >> My problem is that the function also return the text inside the >> combobox. >> is there a way to filter out the combobox text? >> >> the only workaround I can think of is to wrap my text in another div and >> call its text. >> This workaround will be a bit complicated for me because the text on my >> page >> is dynamic and it can come after the input field or before the input >> field >> so I just want to get the text inside the div without the input fields >> text... (This only happens with combobox). >> >> tnx, >> Kazuar >> >> -- >> View this message in >> context:http://www.nabble.com/function-text%28%29-in-jquery-tp21410667s27240p... >> Sent from the jQuery General Discussion mailing list archive at >> Nabble.com. > > -- View this message in context: http://www.nabble.com/function-text%28%29-in-jquery-tp21410667s27240p21418248.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.