Original address: http://www.cnblogs.com/xiaolifeidao/p/3715830.html
. HTML () corresponds to innerHTML in JS for reading and modifying HTML tags of elements
. HTML () is used to read the HTML content of an element (including its HTML tag), and the. HTML () method reads only the first element when used on multiple elements
. Text () to read or modify the plain text content of the element corresponding to the innertext in JS
Text () is used to read the plain text content of an element, including its descendant elements; The text () method cannot be used on a FORM element
. Val () is used to read or modify the value values of form elements
. Val () is the value that is used to read the form elements,. val () can only be used on form elements
About the difference between the three
1. The Val () method is the same as. html (), and can only read the value of the first FORM element if it is applied on more than one element, but. Text () is not the same as they are, if. Text () is applied on more than one element, the text content of all the selected elements is read.
2. HTML (),. Text (),. Val () can use the return value of the callback function to dynamically change the contents of multiple elements.
[Goto] about the difference between HTML (), text (), Val () in jquery