jQuery updates in WordPress 3.2

There have been two major releases of the jQuery library during this release cycle. WordPress 3.1 includes jQuery 1.4.4. WordPress 3.2 will include jQuery 1.6.1. The new jQuery is faster and better but also has some major changes. The two most important changes that all pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party and theme authors must test for are:

  • Selectors that include [property=value] now require quotes. So
    $('input[name=submit]')

    will not work. It needs to be

    $('input[name="submit"]')
  • All ‘selected’, ‘checked’ and ‘disabled’ properties should use the new .prop() method introduced in jQuery 1.6 instead of .attr(). In most cases .attr() will still work but for example
    .attr('checked', '')

    fails (that used to remove the checked=”checked” from checkboxes). More details and a list of all affected properties are on the jQuery’s blog.