Updated to work with latest JQuery version

Switched from .attr to .prop. Added strict mode.