The difference between the append () function and the HTML () function:
In fact, the difference between the two functions is quite large, such as the Append () function can append an element object to the end of the specified element, and the HTML () function is not allowed.
Their most similar function is when setting HTML content for the specified element.
The code example is as follows:
<!DOCTYPE HTML><HTML><Head><MetaCharSet= "Utf-8"><Metaname= "Author"content= "http://www.softwhy.com/" /><title>Ant Tribe</title><Scriptsrc= "Http://libs.baidu.com/jquery/1.9.0/jquery.js"></Script><Scripttype= "Text/javascript">$(function(){ $("#append"). Append ("<b> Ant Tribe </b>"); $("#html"). HTML ("<b> Ant Tribe </b>")});</Script></Head> <Body><DivID= "Append"></Div><DivID= "html"></Div></Body></HTML>
At this point they are somewhat similar in function, but in fact there are differences in nature:
The append () function is to append content to the end of the specified element, while the HTML () function resets the HTML content inside the element.
Related reading:
The 1.append () function can be found in the Append () method section of jquery .
The 2.html () function can be found in the section of the HTML () method of jquery .
The original address is: http://www.softwhy.com/forum.php?mod=viewthread&tid=15058
For more information, refer to: http://www.softwhy.com/jquery/
The difference between the append () function and the HTML () function