.prop() and .attr() essentially do the same thing but .prop() is generally the recommended way of doing things since it deals with Javascript properties instead of HTML attributes (checkout the jQuery docs for .prop() to know more)