<!DOCTYPE html>
<html>
<head>
<style>
p { background:yellow; }
</style>
<script src='http://code.jquery.com/jquery-latest.js'></script>
</head>
<body>
<p>I would like to say: </p>
<script>
$("p").after("<b>Hello</b>");
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
p { background:yellow; }
</style>
<script src='http://code.jquery.com/jquery-latest.js'></script>
</head>
<body>
<b>Hello</b><p>I would like to say: </p>
<script>
$("p").after( $("b") );
</script>
</body>
</html>
BEFORE
<!DOCTYPE html>
<html>
<head>
<style>
p { background:yellow; }
</style>
<script src='http://code.jquery.com/jquery-latest.js'></script>
</head>
<body>
<p> is what I said...</p>
<script>
$("p").before("<b>Hello</b>");
</script>
</body>
</html>
No comments:
Post a Comment