JavaScript Tutorial/jQuery/appendTo
Add tag to body
<html>
<head>
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<style type="text/css">
.changeP { font-weight: bold; color:red;}
</style>
<script type="text/javascript">
$(document).ready(function(){
$("<div><p>Hello</p></div>").appendTo("body")
});
</script>
</head>
<body>
<form>
<input type="radio" value="Option">
</form>
</body>
</html>
Add to body tag
<html>
<head>
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("<p>data</p>").appendTo("body");
});
</script>
</head>
<body>
</body>
</html>
appendTo(content): the reverse of $(A).append(B)
<html>
<head>
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("p").appendTo( $("b") );
});
</script>
<style>
.selected { color:blue; }
</style>
</head>
<body>
<body>
<b>asdf</b><p>asdf: </p>
</body>
</html>