.append( content, [content] ) .append( function(index, html) )
<html> <head> <title>ThaiCreate.Com jQuery Tutorials</title> <style> p { background:yellow; } </style> <script type="text/javascript" src="jquery-1.6.4.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("p").append("<strong>Hello</strong>"); }); </script> </head> <body> <p>I would like to say: </p> </body> </html>
<html> <head> <title>ThaiCreate.Com jQuery Tutorials</title> <style> p { background:yellow; } </style> <script type="text/javascript" src="jquery-1.6.4.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("p").append(document.createTextNode("Hello")); }); </script> </head> <body> <p>I would like to say: </p> </body> </html>
<html> <head> <title>ThaiCreate.Com jQuery Tutorials</title> <style> p { background:yellow; } </style> <script type="text/javascript" src="jquery-1.6.4.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("p").append( $("strong") ); }); </script> </head> <body> <strong>Hello world!!!</strong><p>I would like to say: </p> </body> </html>
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท