After reading (the interesting) .prop() vs .attr() and jQuery Performance : attributes doubt arise in my mind about what is better to use: .prop() or .val() ? I want to set
The other answers explain the main differences pretty well with one exception.
Since jQuery "normalizes" browser differences val() removes carriage returns.
This affects textareas in IE 8 and below.
Example: For the textarea input of
HEL LO
.val() gives you the string "HEL\n\nLO" and a length of 7
.prop("value") gives you the string "HEL\r\n\r\nLO" with a length of 9