changed deprecated .attr() to .prop()