Mon Dec 31, 2012 9:51 pm
<html>
<head>
<title>append,prepend,add after and add before</title>
<!--
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
Note you can download the JQuery package instead of using Google version. -->
<script src="jquery-1.8.3.js"></script>
<script>
$(document).ready(function(){
$("button#B1").click(function(){
$("#part1").append("appended text");
});
$("button#B2").click(function(){
$("#part2").prepend("appended text ");
});
$("button#B3").click(function(){
$("#link").after(" added after text here ");
});
$("button#B4").click(function(){
$("#link").before("before text ");
});
});
</script>
</head>
<body>
<button id="B1">Append</button>
<button id="B2">Preappend</button>
<button id="B3">Append After Element</button>
<button id="B4">Append Before Element</button>
<div id="part1">Text area1 </div>
<div id="part2">Text area2 </div>
<a href="#" id="link" target="_blank" >Sample</a>
</body>
</html>
|
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.