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
Jay Poojara
 
PDF
jQuery
Ivano Malavolta
 
PPTX
jQuery
Jon Erickson
 
PPTX
Web technologies-course 11.pptx
Stefan Oprea
 
PPT
J query presentation
sawarkar17
 
PPT
J query presentation
akanksha17
 
PDF
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Sean Burgess
 
PPTX
Web Development Introduction to jQuery
Laurence Svekis ✔
 
PPTX
Unit-III_JQuery.pptx engineering subject for third year students
MARasheed3
 
PPTX
A Rich Web experience with jQuery, Ajax and .NET
James Johnson
 
PPTX
A to Z about JQuery - Become Newbie to Expert Java Developer
Manoj Bhuva
 
ODP
Jquery- One slide completing all JQuery
Knoldus Inc.
 
PDF
Unit 1 - What is jQuery_Why jQuery_Syntax_Selectors.pdf
RAVALCHIRAG1
 
PDF
Introduction to jQuery
Zeeshan Khan
 
PPT
jQuery for beginners
Divakar Gu
 
PPTX
A Rich Web Experience with jQuery, Ajax and .NET
James Johnson
 
KEY
Week 4 - jQuery + Ajax
baygross
 
PDF
Introduction to jQuery
Nivedhitha Venugopal
 
PPTX
Jquery Complete Presentation along with Javascript Basics
EPAM Systems
 
jQuery
Jay Poojara
 
jQuery
Jon Erickson
 
Web technologies-course 11.pptx
Stefan Oprea
 
J query presentation
sawarkar17
 
J query presentation
akanksha17
 
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Sean Burgess
 
Web Development Introduction to jQuery
Laurence Svekis ✔
 
Unit-III_JQuery.pptx engineering subject for third year students
MARasheed3
 
A Rich Web experience with jQuery, Ajax and .NET
James Johnson
 
A to Z about JQuery - Become Newbie to Expert Java Developer
Manoj Bhuva
 
Jquery- One slide completing all JQuery
Knoldus Inc.
 
Unit 1 - What is jQuery_Why jQuery_Syntax_Selectors.pdf
RAVALCHIRAG1
 
Introduction to jQuery
Zeeshan Khan
 
jQuery for beginners
Divakar Gu
 
A Rich Web Experience with jQuery, Ajax and .NET
James Johnson
 
Week 4 - jQuery + Ajax
baygross
 
Introduction to jQuery
Nivedhitha Venugopal
 
Jquery Complete Presentation along with Javascript Basics
EPAM Systems
 
Ad

Recently uploaded (20)

PPTX
Smart Factory Monitoring IIoT in Machine and Production Operations.pptx
Rejig Digital
 
PDF
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
PDF
GDG Cloud Southlake #44: Eyal Bukchin: Tightening the Kubernetes Feedback Loo...
James Anderson
 
PDF
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
PDF
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
PDF
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
PDF
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
DOCX
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
PDF
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
PDF
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
PPTX
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
PPTX
Practical Applications of AI in Local Government
OnBoard
 
PDF
Next level data operations using Power Automate magic
Andries den Haan
 
PDF
Optimizing the trajectory of a wheel loader working in short loading cycles
Reno Filla
 
PDF
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
Fwdays
 
PDF
Why aren't you using FME Flow's CPU Time?
Safe Software
 
PDF
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
PPTX
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
PPTX
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
Smart Factory Monitoring IIoT in Machine and Production Operations.pptx
Rejig Digital
 
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
GDG Cloud Southlake #44: Eyal Bukchin: Tightening the Kubernetes Feedback Loo...
James Anderson
 
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
Practical Applications of AI in Local Government
OnBoard
 
Next level data operations using Power Automate magic
Andries den Haan
 
Optimizing the trajectory of a wheel loader working in short loading cycles
Reno Filla
 
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
Fwdays
 
Why aren't you using FME Flow's CPU Time?
Safe Software
 
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
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