jquery
jquery
Example: Copy
$('#myDiv').children().css('color', 'red');
Q.2) Attempt any FIVE of the following:
6) What is the use of jQuery animate()
method? 1) Write a jQuery code to scroll the web
page from bottom to top and vice versa.
javascript javascript
Copy Copy
$('#scrollBottom').click(function() { $(document).bind("contextmenu",
function(e) {
$('html, body').animate({ scrollTop: $
(document).height() }, 1000); e.preventDefault(); // Disable right-click
}); });
});
}); if (window.jQuery) {
Copy
Q.3) Attempt any One of the following:
$('#button').click(function() {
1) How is jQuery installed (added) in web
pages? alert("Button clicked!");
html javascript
Copy Copy
<script $('#element').hover(function() {
src="https://code.jquery.com/jquery-
$(this).css('color', 'red');
3.6.0.min.js"></script>
}, function() {
Locally (Download and Include): You
can download the jQuery file from $(this).css('color', 'black');
the official website and store it
});
locally. Then, include it in your HTML
file. 3) Explain fading methods in jQuery.
javascript
Copy
$('#element').fadeIn(1000); // 1000
milliseconds (1 second)
javascript
Copy
$('#element').fadeOut(1000); // 1000
milliseconds (1 second)
javascript
Copy