change: this.text //this code you are not using the "power" of the jquery :D. Its just regular javascript. to: $(this).text()
This should work crossbrowser. Ex: http://jsbin.com/usazu On Wed, May 6, 2009 at 01:08, infoaddicted <jack.lapla...@gmail.com> wrote: > > I have some HTML: > > <a href="#" class="links">Link One</a><br /> > <a href="#" class="links">Link Two</a><br /> > <a href="#" class="links">Link Three</a><br /> > > And the following JQuery JS to test the "onclick" handler > > $(".links").click(function(){ > alert( > "this.text -> " + this.text + "\n" + > //above returns "undefined" in IE 6 > "this.childNodes[0].data -> " + this.childNodes > [0].data + "\n" > //returns expected text in FF and IE 6 > ); > > Why does > this.text > work fine with FF but I need something more convoluted like > this.childNodes[0].data > to get it to work in IE6? I thought that JQuery shielded me from > these wacky cross-browser issues >