replace use of .attr with .prop as per jquery upgrade guide.