Copy code code as follows:
<! Doctype html public "-// W3C // dtd html 4.01 transitional // en" "http://www.w3.org/tr/html4/loose.dtddd" ">>
<html>
<head>
<meta http-equiv = "content-type" content = "text/html; charset = utf-8">
<Title> jQuery </Title>
<script type = "text/javascript" src = "jquery-1.7.2.js"> </script>
<script type = "text/javascript">
$ (function () {
// Appret () usage
// $.com").append 18" worn = 'abc'> hello </li> ");
// $.com").append 18" worn = 'xyz'> world </li> ");
// The usage of Appendto ()
$ ("<li title = 'xyz'> Hello </li>"). Appendto ($ ("ul");
});
</script>
</head>
<body>
<p> Do you think San Siyuan training is good? </p>
<ul>
<li> OK </li>
<li> Very good </li>
<li> Very good </li>
<li> Especially good </li>
<li> Great </li>
<li> Good unable to describe it </li>
</ul>
</body>
</html>
Operate on existing nodes
Copy code code as follows:
<! Doctype html public "-// W3C // dtd html 4.01 transitional // en" "http://www.w3.org/tr/html4/loose.dtddd" ">>
<html>
<head>
<meta http-equiv = "content-type" content = "text/html; charset = utf-8">
<Title> jQuery4 </Title>
<script type = "text/javascript" src = "jquery-1.7.2.js"> </script>
<script type = "text/javascript">
$ (function () {
var li1 = $ (<li Title = 'ABC'> Hello </li> ");
var li2 = $ ("<li title = 'abc'> world </li>");
var li3 = $ ("<li title = 'abc'> hello world </li>");
$ ("ul"). Append (li1);
$ ("ul"). Prepend (li2);
$ ("Ul Li: EQ (4)"). After (li3);
});
</script>
</head>
<body>
<p> Do you think San Siyuan training is good? </p>
<ul>
<li> OK </li>
<li> Very good </li>
<li> Very good </li>
<li> Especially good </li>
<li> Great </li>
<li> Good can be described </li>
</ul>
</body>
</html>