AM 4TH Jquery - Presentation - Final
AM 4TH Jquery - Presentation - Final
• General Structure:
• $(selector).action();
• Example:
• $('p').hide(); // Hides all paragraphs
jQuery Selectors
• • Basic Selectors:
• - $('#id') - Select by ID
• - $('.class') - Select by Class
• - $('tag') - Select by Tag Name
• • Advanced Selectors:
• - $('div:first') - First DIV element
• - $('input:checked') - Checked input elements
DOM Manipulation Theory
• Example:
• $('#content').html('<b>Welcome!</b>');
DOM Manipulation Methods
• Example:
• $('#button').click(function() {
• alert('Button Clicked!');
• });
Common jQuery Events
• Example:
• $.ajax({
• url: 'data.json',
• method: 'GET',
• success: function(response) {
• $('#result').html(response);
• }
• });
AJAX Methods
• Example:
• $('#box').fadeOut('slow');
Animation Functions
• • Current Use:
• - Still used in many websites and legacy projects.
• - Ideal for beginners learning web development.
• • Alternatives:
• - Modern libraries: React, Vue.js, Angular.
• - Vanilla JavaScript for lightweight projects.
Common Mistakes with
jQuery