Use prop instead of attr, per jQuery 1.9 upgrade guide.