Dissecting the JQuery text method(elegantcode.com)

submitted by cwbrandsmacwbrandsma(1711) 2 years, 7 months ago

An interesting question came up at work today. We had some existing code that was using the innerText dom method. It worked fine on IE, but not on Firefox (to be clear, I’m used to that working the other way around). If you look at QuirksMode you will see Firefox is the only browser that does not support this method as well. Turns out if you use innerText on any dom element in IE you will get the text inside the element (in this case a span tag), but in Firefox you just get nothing. Time to see how JQuery does what it does.

add a comment |category: |Views: 247

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

No comments so far

information Login or create an account to comment on this story