SlideShare a Scribd company logo
An Introduction to jQuery
Pooja Saxena
Topics to cover
2
 Introduction
 Features
 Selectors
 Animations
 Events
 Manipulating HTML/CSS
 Traversing
 Ajax
What is jQuery?
3
 Is a free , open Javascript library
 Founded in 2006 with the motto - Write
Less - Do More
 What it does - Simplifies the task of
creating highly responsive web pages
 Not at all related to Java
 Works across modern browsers
 Can be enabled in your page by
including reference to jQuery library file
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
Typical Usage
4
 HTML/DOM manipulation
 CSS manipulation
 Event handling
 Animating
 Traversing
 Ajax interactions for rapid web
development
Selectors
jQuery selectors start with the dollar sign and − $().
$() is a synonym of jQuery()
 Name -Selects all elements which match with the given
element Name.
 #ID -Selects a single element which matches with the given
ID.
 .Class -Selects all elements which match with the given
Class.
 Universal (*) - Selects all elements available in a DOM.
 Multiple Elements E, F, G - Selects the combined results of all
the specified selectors E, F or G.
5
Animations
 jQuery provides several techniques for adding animation to a
web page to craft sophisticated custom effects.
 Frequently used effects are built into jQuery as methods that
you can call on any jQuery object.
◦ .show() Show the selected elements.
◦ .hide() Hide the selected elements.
◦ .fadeIn() Animate the opacity of the selected elements to
100%.
◦ .fadeOut() Animate the opacity of the selected elements to 0%.
◦ .slideDown() Display the selected elements with a vertical sliding
motion.
◦ .slideUp() Hide the selected elements with a vertical sliding
motion.
◦ .toggle() Show or hide the selected elements with a vertical
sliding motion, depending on whether the elements are currently
visible.
6
Events
 What are Events?
◦ An event represents the precise moment
when some action happens that can be
detected by your Web Application
 Examples:
◦ Mouse click
◦ Web page loading
◦ Mouse over an element
◦ Submitting an HTML form
◦ A keystroke on your keyboard. Etc.
7
Manipulating HTML/CSS
8
 JQuery provides methods to manipulate DOM/CSS in efficient
way.
 Almost all methods acts as getter or setter for HTML
element's attribute
 DOM manipulation includes
◦ Add, Remove or modify any element or its attribute
 CSS manipulation includes
◦ Altering any of the style properties of DOM elments
Traversing
9
 Used to filter out elements from a document based on given
conditions.
 Some common methods which are used for traversing are :-
◦ children() Returns all direct children of the selected element
◦ closest() Returns the first ancestor of the selected element
◦ each() Executes a function for each matched element
◦ eq() Returns an element with a specific index number of the
selected elements
◦ find() Returns descendant elements of the selected element
◦ first() Returns the first element of the selected elements
◦ last() Returns the last element of the selected elements
◦ next() Returns the next sibling element of the selected element
◦ parent() Returns the direct parent element of the selected element
◦ prev() Returns the previous sibling element of the selected element
Ajax
 $.get( url, [data], [callback], [type] )
◦ Requests data from the server with an HTTP GET request.
 $.getJSON( url, [data], [callback] )
◦ Load JSON data using an HTTP GET request.
 $.post( url, [data], [callback], [type] )
◦ Requests data from the server using an HTTP POST request.
 $.ajax( options )
◦ Load a remote page using an HTTP request. Can be called for
get/post/put/delete requests
 serialize( )
◦ Called on forms usually before sending request to server. It creates a URL
encoded text string by serializing form values.
 serializeArray( )
◦ Serializes all forms and form elements like the .serialize() method but
returns a JSON data structure for you to work with.
10
Examples
https://jsfiddle.net/1jrvtwcq/20/

More Related Content

What's hot (20)

PPTX
Introduction to Jquery
Ahmed Elharouny
 
PPT
Jquery presentation
Narendra Dabhi
 
PDF
Utilising the data attribute
Richard Martens
 
PPT
J Query Public
pradeepsilamkoti
 
PPTX
Introduction to JQuery
Muhammad Afzal Qureshi
 
PPTX
Jqueryppt (1)
AndreaSmile06
 
PDF
jQuery Introduction
Arwid Bancewicz
 
PPTX
Css Selectors
Igor Ognichenko
 
PDF
JavaScript - Chapter 11 - Events
WebStackAcademy
 
PDF
Angular js 2.0, ng poznań 20.11
Kamil Augustynowicz
 
PPTX
JQuery
Jacob Nelson
 
PPTX
J Query The Write Less Do More Javascript Library
rsnarayanan
 
PPTX
Efficient use of jQuery selector
chandrashekher786
 
PDF
Introducing jQuery
Wildan Maulana
 
ODP
Jquery for Beginners
Mohd Abdul Baquee
 
PPTX
Jquery Basics
Umeshwaran V
 
PDF
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
Edureka!
 
Introduction to Jquery
Ahmed Elharouny
 
Jquery presentation
Narendra Dabhi
 
Utilising the data attribute
Richard Martens
 
J Query Public
pradeepsilamkoti
 
Introduction to JQuery
Muhammad Afzal Qureshi
 
Jqueryppt (1)
AndreaSmile06
 
jQuery Introduction
Arwid Bancewicz
 
Css Selectors
Igor Ognichenko
 
JavaScript - Chapter 11 - Events
WebStackAcademy
 
Angular js 2.0, ng poznań 20.11
Kamil Augustynowicz
 
JQuery
Jacob Nelson
 
J Query The Write Less Do More Javascript Library
rsnarayanan
 
Efficient use of jQuery selector
chandrashekher786
 
Introducing jQuery
Wildan Maulana
 
Jquery for Beginners
Mohd Abdul Baquee
 
Jquery Basics
Umeshwaran V
 
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
Edureka!
 

Similar to jQuery basics for Beginners (20)

PPTX
JQuery
DevTalk
 
PPTX
A to Z about JQuery - Become Newbie to Expert Java Developer
Manoj Bhuva
 
PPT
jQuery for beginners
Divakar Gu
 
PDF
Unit 1 - What is jQuery_Why jQuery_Syntax_Selectors.pdf
RAVALCHIRAG1
 
PPTX
Web technologies-course 11.pptx
Stefan Oprea
 
PPTX
A Rich Web Experience with jQuery, Ajax and .NET
James Johnson
 
PPTX
A Rich Web experience with jQuery, Ajax and .NET
James Johnson
 
PPTX
jQuery quick tuts
Nasa Vietnam
 
PDF
Introduction to jQuery
Zeeshan Khan
 
PDF
jQuery
Ivano Malavolta
 
PPTX
Jquery Complete Presentation along with Javascript Basics
EPAM Systems
 
PPTX
Web Development Course - JQuery by RSOLUTIONS
RSolutions
 
PPTX
JQuery_and_Ajax.pptx
AditiPawale1
 
PPTX
jQuery besic
Syeful Islam
 
PPTX
jQuery Presentasion
Mohammad Usman
 
PPTX
presentation_jquery_ppt.pptx
azz71
 
PPTX
J query
Ramakrishna kapa
 
PPTX
Unit3.pptx
AnamikaRai59
 
PPTX
jQuery
Vishwa Mohan
 
JQuery
DevTalk
 
A to Z about JQuery - Become Newbie to Expert Java Developer
Manoj Bhuva
 
jQuery for beginners
Divakar Gu
 
Unit 1 - What is jQuery_Why jQuery_Syntax_Selectors.pdf
RAVALCHIRAG1
 
Web technologies-course 11.pptx
Stefan Oprea
 
A Rich Web Experience with jQuery, Ajax and .NET
James Johnson
 
A Rich Web experience with jQuery, Ajax and .NET
James Johnson
 
jQuery quick tuts
Nasa Vietnam
 
Introduction to jQuery
Zeeshan Khan
 
Jquery Complete Presentation along with Javascript Basics
EPAM Systems
 
Web Development Course - JQuery by RSOLUTIONS
RSolutions
 
JQuery_and_Ajax.pptx
AditiPawale1
 
jQuery besic
Syeful Islam
 
jQuery Presentasion
Mohammad Usman
 
presentation_jquery_ppt.pptx
azz71
 
Unit3.pptx
AnamikaRai59
 
jQuery
Vishwa Mohan
 
Ad

Recently uploaded (20)

PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Digital Circuits, important subject in CS
contactparinay1
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Ad

jQuery basics for Beginners

  • 1. An Introduction to jQuery Pooja Saxena
  • 2. Topics to cover 2  Introduction  Features  Selectors  Animations  Events  Manipulating HTML/CSS  Traversing  Ajax
  • 3. What is jQuery? 3  Is a free , open Javascript library  Founded in 2006 with the motto - Write Less - Do More  What it does - Simplifies the task of creating highly responsive web pages  Not at all related to Java  Works across modern browsers  Can be enabled in your page by including reference to jQuery library file <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
  • 4. Typical Usage 4  HTML/DOM manipulation  CSS manipulation  Event handling  Animating  Traversing  Ajax interactions for rapid web development
  • 5. Selectors jQuery selectors start with the dollar sign and − $(). $() is a synonym of jQuery()  Name -Selects all elements which match with the given element Name.  #ID -Selects a single element which matches with the given ID.  .Class -Selects all elements which match with the given Class.  Universal (*) - Selects all elements available in a DOM.  Multiple Elements E, F, G - Selects the combined results of all the specified selectors E, F or G. 5
  • 6. Animations  jQuery provides several techniques for adding animation to a web page to craft sophisticated custom effects.  Frequently used effects are built into jQuery as methods that you can call on any jQuery object. ◦ .show() Show the selected elements. ◦ .hide() Hide the selected elements. ◦ .fadeIn() Animate the opacity of the selected elements to 100%. ◦ .fadeOut() Animate the opacity of the selected elements to 0%. ◦ .slideDown() Display the selected elements with a vertical sliding motion. ◦ .slideUp() Hide the selected elements with a vertical sliding motion. ◦ .toggle() Show or hide the selected elements with a vertical sliding motion, depending on whether the elements are currently visible. 6
  • 7. Events  What are Events? ◦ An event represents the precise moment when some action happens that can be detected by your Web Application  Examples: ◦ Mouse click ◦ Web page loading ◦ Mouse over an element ◦ Submitting an HTML form ◦ A keystroke on your keyboard. Etc. 7
  • 8. Manipulating HTML/CSS 8  JQuery provides methods to manipulate DOM/CSS in efficient way.  Almost all methods acts as getter or setter for HTML element's attribute  DOM manipulation includes ◦ Add, Remove or modify any element or its attribute  CSS manipulation includes ◦ Altering any of the style properties of DOM elments
  • 9. Traversing 9  Used to filter out elements from a document based on given conditions.  Some common methods which are used for traversing are :- ◦ children() Returns all direct children of the selected element ◦ closest() Returns the first ancestor of the selected element ◦ each() Executes a function for each matched element ◦ eq() Returns an element with a specific index number of the selected elements ◦ find() Returns descendant elements of the selected element ◦ first() Returns the first element of the selected elements ◦ last() Returns the last element of the selected elements ◦ next() Returns the next sibling element of the selected element ◦ parent() Returns the direct parent element of the selected element ◦ prev() Returns the previous sibling element of the selected element
  • 10. Ajax  $.get( url, [data], [callback], [type] ) ◦ Requests data from the server with an HTTP GET request.  $.getJSON( url, [data], [callback] ) ◦ Load JSON data using an HTTP GET request.  $.post( url, [data], [callback], [type] ) ◦ Requests data from the server using an HTTP POST request.  $.ajax( options ) ◦ Load a remote page using an HTTP request. Can be called for get/post/put/delete requests  serialize( ) ◦ Called on forms usually before sending request to server. It creates a URL encoded text string by serializing form values.  serializeArray( ) ◦ Serializes all forms and form elements like the .serialize() method but returns a JSON data structure for you to work with. 10

Editor's Notes

  • #3: After first session add lines