jQuery .attr() and .prop() both are almost same with some differences.

With .attr() you can get or set the HTML attribute.

With .prop() you can get or set the HTML DOM element.

Suppose an HTML element <input type="text" id="test" value="Initial value" />. Here if you want to get value with both methods, you will get Initial value. Now once you change the value by typing something, $( "#test" ).attr( "value" ) will return Initial value, whereas $( "#test" ).prop( "value" ) it will return the modified or new value.