Fixed the attribute setting to conform to jQuery 1.9 specifications.

This fix deals with the issue of setting properties on a jQuery object instead of setting an attribute in its serialized state:
http://jquery.com/upgrade-guide/1.9/#attr-versus-prop-