<Head>
<Meta charset = "UTF-8"/>
<Script type = "text/javascript" src = "../script/jquery-1.4.2.min.js"> </script>
<Script>
/* Create a node */
$ (Function (){
// 1. Create an element node append
Var $ li = $ ("<li> </li> ");
$ ("Ul"). append ($ li );
// 2. Create an attribute node. When creating an element node, write the attribute as OK.
Var $ title = $ ("<li title = apple> </li> ");
$ ("Ul"). append ($ title );
// 3. Create a text node. When creating an element node, it is OK to write the text content.
Var $ content = $ ("<li> mango </li> ");
$ ("Ul"). append ($ content );
// Differentiate between append () and appendTo ()
// Append () the parent element xxx is the child element.
// AppendTo (): append a matched element to an element.
Var $ girl = $ ("<p title = peach> Hello </p> ");
$ Girl. appendTo ($ ("body "));
});
</Script>
</Head>
<Body>
<P title = "Fruit"> your favorite fruit </p>
<Ul>
<Li title = "orange"> orange </li>
<Li> Apple </li>
<Li> li </li>
</Ul>
</Body>
</Html>