Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 1
    Thanks Hiral for the fast response. +1 for that alone. I tried nearly an identical version of this but made the mistake of putting 'data' where the .attr is. One question though - does having the code bubble down from the body tag make this slower on a 1200 line code page than identifying directly the class '.showEdt' ? Commented Nov 17, 2013 at 14:21
  • You are welcome :) I dont think there would be much difference. I suggest you to try out and compare both approaches. Commented Nov 17, 2013 at 16:18
  • 1
    I did exactly as you suggested. Following the advice in this excellent article on improving jQuery for speed the results were really useful: Hiral solution = direct process time (1.935ms) and full impact to page (71.03ms) || vape solution = direct process time (1.765ms) and full impact to page (59.33ms) Commented Nov 17, 2013 at 16:43