[jQuery] Re: How to find elements with an exact text content?

2007-07-04 Thread Nicolas Hoizey
> You can try the powerful .filter() method with an anonymous > function as its argument: > > $('someElement').filter(function() { > return $(this).text() == 'Some text'; > }); It works well, but wouldn't it be very useful (and very "write less, do more") to have such a feature: $('someEle

[jQuery] Re: How to find elements with an exact text content?

2007-07-04 Thread Nicolas Hoizey
Hello Renato, I also saw your answer on the french list... ;-) >> I'm currently using :contains() to find elements that contain >> some string: >> >> I would like now to find only elements that have a text content >> exactly equal

[jQuery] Re: How to find elements with an exact text content?

2007-07-04 Thread Renato Formato
Nicolas Hoizey ha scritto: Hi, I'm currently using :contains() to find elements that contain some string: I would like now to find only elements that have a text content exactly equal to the string I chose. I didn't find any s

[jQuery] Re: How to find elements with an exact text content?

2007-07-03 Thread Nicolas Hoizey
> As far as I know, .textContent only works in Firefox. The IE > equivalent is .innerText. > jQuery normalizes this with its .text() method. Thanks a lot! -Nicolas -- Nicolas "Brush" HOIZEY Clever Age : http://www.clever-age.com/ Gastero Prod : http://www.gasteroprod.com/ Photos : http://

[jQuery] Re: How to find elements with an exact text content?

2007-07-03 Thread Karl Swedberg
Hi Nicolas, As far as I know, .textContent only works in Firefox. The IE equivalent is .innerText. jQuery normalizes this with its .text() method. btw, .text() can also be used as a "setter": $(someElement).text ('This is some text'); --Karl _ Karl Swedberg www.englishrul

[jQuery] Re: How to find elements with an exact text content?

2007-07-03 Thread Nicolas Hoizey
>> You can try the powerful .filter() method with an anonymous >> function as its argument: >> >> $('someElement').filter(function() { >> return $(this).text() == 'Some text'; >> }); > > I will try this, thanks! It works well! Do you think it is usefull, for performance, to first filter with

[jQuery] Re: How to find elements with an exact text content?

2007-07-03 Thread Nicolas Hoizey
Hi Karl, > You can try the powerful .filter() method with an anonymous > function as its argument: > > $('someElement').filter(function() { > return $(this).text() == 'Some text'; > }); I will try this, thanks! What is the difference between .text() and .textContent? -Nicolas -- Nicolas

[jQuery] Re: How to find elements with an exact text content?

2007-07-03 Thread Karl Swedberg
Hi there Nicolas, You can try the powerful .filter() method with an anonymous function as its argument: $('someElement').filter(function() { return $(this).text() == 'Some text'; }); I'm pretty sure that will get what you're looking for. --Karl _ Karl Swedberg www.english