To increase the efficiency of jQuery, these are some tips:
- Use a class or an id attribute to allow one to identify the item(s) more directly. eg. $('#id_name') or $('.class_name')
- Cache the selector that is long and used many times. eg. var link=$("div ul li a"); To use it type: $(link)
- Troubleshoot with Firebug (http://getfirebug.com/) and minify your code with the Google Closure Compiler(https://developers.google.com/closure/compiler/)
- Troubleshoot 2:Use jsFiddle(http://jsfiddle.net/) to test a jQuery code.