Jquery After And Before Tricks Now Follow This Steps
Step1: Now Type Head Tag Jquery CDN Link
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
Step2: Now Type Body Tag And Type Script Call To Action
<script>
$(document).ready(function(){
$("#btn1").click(function(){
$("img").before("<b>Before</b>");
});
$("#btn2").click(function(){
$("img").after("<i>After</i>");
});
});
</script>
Step3: Now Type Html Code
<img src="../Pictures/Sample Pictures/Chrysanthemum.jpg" alt="jQuery" width="100" height="140">
Step3: Now Type Html Button Code Insert After And Before
<button id="btn1">Insert before</button>
<button id="btn2">Insert after</button>
Now Type a Full Code
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#btn1").click(function(){
$("img").before("<b>Before</b>");
});
$("#btn2").click(function(){
$("img").after("<i>After</i>");
});
});
</script>
</head>
<body>
<img src="file:///C|/Users/Public/Pictures/Sample Pictures/Chrysanthemum.jpg" alt="jQuery" width="100" height="140"><br><br>
<button id="btn1">Insert before</button>
<button id="btn2">Insert after</button>
</body>
</html>

0 comments:
Thnak You For Comment And For Your Question, Answer Very Soon.