What is the difference between the html () and text () jQuery methods? textjquery
What are the differences between the html () and text () jQuery methods:
The two methods in the title are very commonly used by jQuery, and sometimes the functions seem to be the same. In fact, this is just an illusion. The following uses examples to introduce their differences, first, let's look at a code example:
<! DOCTYPE html>
In the above Code, both methods can set the content in the div to "ant tribe", which seems to have the same effect.
Let's take a look at the example code:
<! DOCTYPE html>
The differences between the two methods are obvious in the above Code. The html () method can parse html code like a browser, while the text () method only uses html code as common text, in this way, the differences between them are obvious.
The original address is: http://www.softwhy.com/forum.php? Mod = viewthread & tid = 5794.
For more information, see: http://www.softwhy.com/jquery/