In this article of Jquery we will learn about Chaining so Let's start.
@{
ViewBag.Title = "Chaining";
}
<h2>Chaining</h2>
<!DOCTYPE html>
<html>
<head>
</head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="~/js/Chaining.js" type="text/javascript"></script>
<body>
<!--The following example chains together the css(), slideUp(), and slideDown() methods. The "p1" element first changes to red, then it slides up, and then it slides down:-->
<h3>The following example chains together the css(), slideUp(), and slideDown() methods. The "p1" element first changes to red, then it slides up, and then it slides down:</h3>
<p id="firstpara">Hello ! ! !</p>
<button id="firstbtn">Enter</button>
<!--End-->
<script>
$(document).ready(function () {
$("#firstbtn").click(function () {
$("#firstpara").css("color", "red").slideUp(1000).slideDown(1000)
});
});
</script>
</body>
</html>
Comments
Post a Comment