Copy codeThe Code is as follows:
<Script src = "jquery-1.9.1.js" type = "text/javascript"> </script>
<Script type = "text/javascript">
$ (Function (){
$ ('# Button1'). click (function (){
// Var ha = '<p> a </p> ';
// $ ('Div '). append (ha );
// 1
// Var w = '<a href = "#"> f4 </a>'
// $ ('Div '). append (w );
// Var sele = '<select> <option> 1 </option> <option> 2 </option> <option> 3 </option> </select>'
// $ ('Div '). append (sele );
})
})
// 2var pstr = '<p> <B> <I> the Yellow River enters the ocean </br> to reach the next level </br>/ i> </B> </p> '; $ ('div '). append (pstr); change it to js for writing, the effect is the same
Function ha (){
// Var p = document. createElement ('P ');
// Var B = document. createElement ('B ');
// Var I = document. createElement ('I ');
// Var neirong1 = document. createTextNode ('day by day ');
// Var br1 = document. createElement ('br ')
// Var neirong2 = document. createTextNode ('Yellow River currents ');
// Var br2 = document. createElement ('br ')
// Var neirong3 = document. createTextNode ('thousands of miles away ');
// Var br3 = document. createElement ('br ')
// Var neirong4 = document. createTextNode ('upgrade ');
// I. appendChild (neirong1 );
// I. appendChild (br1 );
// I. appendChild (neirong2 );
// I. appendChild (br2 );
// I. appendChild (neirong3 );
// I. appendChild (br3 );
// I. appendChild (neirong4 );
//
// B. appendChild (I );
// P. appendChild (B );
// Document. getElementById ('did1'). appendChild (p );
}
</Script>
</Head>
<Body>
<Input id = "Button1" type = "button" value = "create node"/>
<Input id = "Button2" type = "button" value = "2" onclick = "ha ()"/>
<Div id = "div1"> </div>