Home >Web Front-end >Front-end Q&A >What does append mean in jquery
In jquery, append means "append", which is used to insert specified content at the end of the selected element; the syntax is "$(A).append(B)", which means going to the end of A Insert B content (can include HTML tags).
The operating environment of this tutorial: windows7 system, jquery1.10.2 version, Dell G3 computer.
append means "append" and is a built-in method in jquery.
The append() method can insert specified content at the end of the selected element.
Syntax:
$(A).append(B)
means inserting B (can include HTML tags) at the end of A.
The content to be inserted can be:
HTML element
jQuery object
DOM element
Example:
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> <style type="text/css"> p { background-color: orange; } </style> <script src="js/jquery-1.10.2.min.js"></script> <script> $(function () { $("#btn").click(function () { var $strong = "<strong>jQuery教程</strong>"; $("p").append($strong); }) }) </script> </head> <body> <p>php中文网</p> <input id="btn" type="button" value="插入" /> </body> </html>
[Recommended learning:jQuery video tutorial、webfront-end video】
The above is the detailed content of What does append mean in jquery. For more information, please follow other related articles on the PHP Chinese website!