SlideShare une entreprise Scribd logo
1  sur  21
By mishraDileep
Agenda
 Introduction, Prerequisite    jQuery Filters
 What is jQuery?               jQuery Attributes
 What is available with        jQuery Events
  jQuery?                       jQuery Callback Functions
 How to use jQuery?            jQuery HTML Manipulation
 jQuery Syntax                 jQuery CSS Manipulation
 jQuery Selectors
Introduction & Prerequisites
 A JavaScript library
 Easy to learn and implement
 jQuery is a fast and concise JavaScript Library that simplifies
    HTML document traversing
    Event handling
    Animation
    AJAX Interaction for rapid web development


 Prerequisites
    HTML
    CSS
    JavaScript
What is jQuery?
 A library of JavaScript Functions.
 A lightweight "write less, do more" JavaScript library.
 The jQuery library contains the following features:
         HTML element selections
         HTML element manipulation
         CSS manipulation
         HTML event functions
         JavaScript Effects and animations
         HTML DOM traversal and modification
         AJAX
         Utilities

 An open source project, maintained by group of developers
  with active support base and well written documentation
What is available with jQuery
 Cross Browser support     JavaScript Animation
 AJAX Functions            Hundreds of plug-ins for
 CSS functions              pre-built user interfaces,
                             advanced animation and
 DOM Manipulation
                             form validation etc …
 DOM Traversing
                            Expandable using custom
 Attribute Manipulation     plug-ins
 Event detection and       Small footprint
 handling
How to use jQuery?
 A single JavaScript file, containing all the jQuery methods.

 Add the following code into your html/jsp page and call the jQuery APIs.
          <head>
           <script type="text/javascript" src="jquery.js"></script>
           </head>
 For Example
          <html>
           <head>
           <script type="text/javascript" src="jquery.js"></script>
           <script type="text/javascript">
           $(document).ready(function(){
            $("button").click(function(){
               $("p").hide();
            });
           });
           </script>
           </head>
           <body>
           <h2>This is a heading</h2>
           <p>This is a paragraph.</p>
           <p>This is another paragraph.</p>
           <button>Click me</button>
           </body>
           </html>
How to use jQuery?Cont…
 In order to use jQuery you need to load it.
 You can include it locally on your own server:
    <script src="/js/jquery.js">
 Or use one of the CDN's made available:
    ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
    ajax.microsoft.com/ajax/jquery/jquery-1.4.2.js
    CDN's are Gzipped and minified
jQuery Syntax
 With jQuery you select (query) HTML elements and
  perform "actions" on them.
 jQuery Syntax Examples
      $(this).hide()
      $("#test").hide()
      $("p").hide()
      $(".test").hide()

 Basic syntax is: $(selector).action()
    A dollar sign to define jQuery
    A (selector) to "query (or find)" HTML elements
    A jQuery action() to be performed on the element(s)
jQuery Selectors
 To select HTML elements (or groups of elements) by
  element name, attribute name or by content.

 jQuery Element Selectors
    Uses CSS selectors to select HTML elements.
       $("p“)
       $("p.intro“)
       $("p#demo“)
jQuery Selectors
 jQuery Attribute Selectors
    jQuery uses XPath expressions to select elements with given
     attributes.
    $("[href ]“)
    $("[href='#']")
    $("[href!='#']“).
    $("[href$='.jpg']“)
 jQuery CSS Selectors
    jQuery CSS selectors can be used to change CSS properties for
     HTML elements.
    For Ex :
        $("p").css("background-color","yellow");
jQuery Selectors
 Few samples for the selectors
Syntax                Description
$(this)               Current HTML element
$("p")                All <p> elements
$("p.intro")          All <p> elements with class="intro"
$(".intro")           All elements with class="intro"
$("#intro")           The first element with id="intro"
$("ul li:first")      The first <li> element of each <ul>
$("[href$='.jpg']")   All elements with an href attribute that ends with ".jpg"
$("div#intro          All elements with class="head" inside a <div> element with
.head")               id="intro"
jQuery Filters
 First paragraph – p:first
 Last list item – li:last
 Fourth link – a:nth(3)
 Fourth Div – div:eq(3)
 Every other Paragraph – p:odd or p:even
 Every link after/upto 4th – a:gt(3) or a:lt(4)
 Links that contain word like click – a:contains(“click”)
 All radio inputs with in first form - $(“input:radio”,
  documents.forms[0])
jQuery Attributes
 Read
    $(#image).attr(“src”);
 Set
    $(#image).attr(“src” , “images/jquery1.jpg”);
 Multiple Set
    $(#image).attr({src: “images/jquery1.jpg” , alt: “jQuery”});
 Set Class
    $(p:last).addClass(“selected”);
 Read/Set Html
    $(#id).html() & $(#id).html(“value”);
jQuery Events
 The jQuery event handling methods are core functions in jQuery.

 For Example
       <html>
        <head>
        <script type="text/javascript" src="jquery.js"></script>
        <script type="text/javascript">
        $(document).ready(function(){
         $("button").click(function(){
            $("p").hide();
         });
        });
        </script>
        </head>
        <body>
        <h2>This is a heading</h2>
        <p>This is a paragraph.</p>
        <p>This is another paragraph.</p>
        <button>Click me</button>
        </body></html>
jQuery Callback Functions
 A callback function is executed after the current
  animation (effect) is finished.
 Syntax
   $(selector).hide(speed,callback)
 For Ex:
    $("p").hide(1000,function(){
      alert("The paragraph is now hidden");
     });
jQuery HTML Manipulation
 jQuery can manipulate the HTML elements and
  attributes
 Changing HTML Content
   $(selector).html(content)
 Adding HTML content
    $(selector).append(content)
    $(selector).prepend(content)
    $(selector).after(content)
    $(selector).before(content)
jQuery HTML Manipulation
  jQuery HTML Manipulation Methods

Function                      Description

$(selector).html(content)     Changes the (inner) HTML of selected elements

                              Appends content to the (inner) HTML of selected
$(selector).append(content)
                              elements

$(selector).after(content)    Adds HTML after selected elements
jQuery CSS Manipulation
 jQuery css() Method
    css(name) - Return CSS property value
    css(name,value) - Set CSS property and value
    css({properties}) - Set multiple CSS properties and values
 Examples
    Return CSS Property
        $(this).css("background-color");
    Set CSS Property & value
      $("p").css("background-color"," yellow");
    Set Multiple values in CSS
      $("p").css({"background-color":"yellow","font-size":"200%"});
    Size Manipulation
      $("#div1").height("200px"); $("#div2").width("300px");
jQuery CSS Manipulation
 Offset
   $(this).offset().left
   $(this).offset().top


 Position
    $(this).position().left
    $(this).position().top
jQuery CSS Manipulation
 jQuery CSS Manipulation Methods
CSS Properties                  Description

                                Get the style property value of the first
$(selector).css(name)
                                matched element

                                Set the value of one style property for
$(selector).css(name,value)
                                matched elements

                                Set multiple style properties for
$(selector).css({properties})
                                matched elements

$(selector).height(value)       Set the height of matched elements
$(selector).width(value)        Set the width of matched elements
jQuery

Contenu connexe

Tendances

Javascript variables and datatypes
Javascript variables and datatypesJavascript variables and datatypes
Javascript variables and datatypes
Varun C M
 

Tendances (20)

jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
 
Basics of JavaScript
Basics of JavaScriptBasics of JavaScript
Basics of JavaScript
 
Bootstrap
BootstrapBootstrap
Bootstrap
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
3. Java Script
3. Java Script3. Java Script
3. Java Script
 
HTML Fundamentals
HTML FundamentalsHTML Fundamentals
HTML Fundamentals
 
Javascript variables and datatypes
Javascript variables and datatypesJavascript variables and datatypes
Javascript variables and datatypes
 
Css Ppt
Css PptCss Ppt
Css Ppt
 
JavaScript: Events Handling
JavaScript: Events HandlingJavaScript: Events Handling
JavaScript: Events Handling
 
jQuery
jQueryjQuery
jQuery
 
javascript objects
javascript objectsjavascript objects
javascript objects
 
Html5 and-css3-overview
Html5 and-css3-overviewHtml5 and-css3-overview
Html5 and-css3-overview
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery Fundamentals
 
Java script
Java scriptJava script
Java script
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Js ppt
Js pptJs ppt
Js ppt
 
Jsp ppt
Jsp pptJsp ppt
Jsp ppt
 
Operators php
Operators phpOperators php
Operators php
 

En vedette (6)

jQuery PPT
jQuery PPTjQuery PPT
jQuery PPT
 
Jqueryppt (1)
Jqueryppt (1)Jqueryppt (1)
Jqueryppt (1)
 
jQuery Presentation
jQuery PresentationjQuery Presentation
jQuery Presentation
 
jQuery from the very beginning
jQuery from the very beginningjQuery from the very beginning
jQuery from the very beginning
 
Learning jQuery in 30 minutes
Learning jQuery in 30 minutesLearning jQuery in 30 minutes
Learning jQuery in 30 minutes
 
jQuery Essentials
jQuery EssentialsjQuery Essentials
jQuery Essentials
 

Similaire à jQuery

presentation_jquery_ppt.pptx
presentation_jquery_ppt.pptxpresentation_jquery_ppt.pptx
presentation_jquery_ppt.pptx
azz71
 

Similaire à jQuery (20)

J query training
J query trainingJ query training
J query training
 
Jquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript BasicsJquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript Basics
 
jQuery Rescue Adventure
jQuery Rescue AdventurejQuery Rescue Adventure
jQuery Rescue Adventure
 
Introduzione JQuery
Introduzione JQueryIntroduzione JQuery
Introduzione JQuery
 
How to increase Performance of Web Application using JQuery
How to increase Performance of Web Application using JQueryHow to increase Performance of Web Application using JQuery
How to increase Performance of Web Application using JQuery
 
jQuery
jQueryjQuery
jQuery
 
Intro to jQuery
Intro to jQueryIntro to jQuery
Intro to jQuery
 
Jquery 2
Jquery 2Jquery 2
Jquery 2
 
presentation_jquery_ppt.pptx
presentation_jquery_ppt.pptxpresentation_jquery_ppt.pptx
presentation_jquery_ppt.pptx
 
J Query Public
J Query PublicJ Query Public
J Query Public
 
Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...
 
Advanced JQuery Mobile tutorial with Phonegap
Advanced JQuery Mobile tutorial with Phonegap Advanced JQuery Mobile tutorial with Phonegap
Advanced JQuery Mobile tutorial with Phonegap
 
Jquery
JqueryJquery
Jquery
 
jQuery Presentasion
jQuery PresentasionjQuery Presentasion
jQuery Presentasion
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentation
 
J query
J queryJ query
J query
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
jQuery Basic API
jQuery Basic APIjQuery Basic API
jQuery Basic API
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

jQuery

  • 2. Agenda  Introduction, Prerequisite  jQuery Filters  What is jQuery?  jQuery Attributes  What is available with  jQuery Events jQuery?  jQuery Callback Functions  How to use jQuery?  jQuery HTML Manipulation  jQuery Syntax  jQuery CSS Manipulation  jQuery Selectors
  • 3. Introduction & Prerequisites  A JavaScript library  Easy to learn and implement  jQuery is a fast and concise JavaScript Library that simplifies  HTML document traversing  Event handling  Animation  AJAX Interaction for rapid web development  Prerequisites  HTML  CSS  JavaScript
  • 4. What is jQuery?  A library of JavaScript Functions.  A lightweight "write less, do more" JavaScript library.  The jQuery library contains the following features:  HTML element selections  HTML element manipulation  CSS manipulation  HTML event functions  JavaScript Effects and animations  HTML DOM traversal and modification  AJAX  Utilities  An open source project, maintained by group of developers with active support base and well written documentation
  • 5. What is available with jQuery  Cross Browser support  JavaScript Animation  AJAX Functions  Hundreds of plug-ins for  CSS functions pre-built user interfaces, advanced animation and  DOM Manipulation form validation etc …  DOM Traversing  Expandable using custom  Attribute Manipulation plug-ins  Event detection and  Small footprint handling
  • 6. How to use jQuery?  A single JavaScript file, containing all the jQuery methods.  Add the following code into your html/jsp page and call the jQuery APIs.  <head> <script type="text/javascript" src="jquery.js"></script> </head>  For Example  <html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("button").click(function(){ $("p").hide(); }); }); </script> </head> <body> <h2>This is a heading</h2> <p>This is a paragraph.</p> <p>This is another paragraph.</p> <button>Click me</button> </body> </html>
  • 7. How to use jQuery?Cont…  In order to use jQuery you need to load it.  You can include it locally on your own server:  <script src="/js/jquery.js">  Or use one of the CDN's made available:  ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js  ajax.microsoft.com/ajax/jquery/jquery-1.4.2.js  CDN's are Gzipped and minified
  • 8. jQuery Syntax  With jQuery you select (query) HTML elements and perform "actions" on them.  jQuery Syntax Examples  $(this).hide()  $("#test").hide()  $("p").hide()  $(".test").hide()  Basic syntax is: $(selector).action()  A dollar sign to define jQuery  A (selector) to "query (or find)" HTML elements  A jQuery action() to be performed on the element(s)
  • 9. jQuery Selectors  To select HTML elements (or groups of elements) by element name, attribute name or by content.  jQuery Element Selectors  Uses CSS selectors to select HTML elements.  $("p“)  $("p.intro“)  $("p#demo“)
  • 10. jQuery Selectors  jQuery Attribute Selectors  jQuery uses XPath expressions to select elements with given attributes.  $("[href ]“)  $("[href='#']")  $("[href!='#']“).  $("[href$='.jpg']“)  jQuery CSS Selectors  jQuery CSS selectors can be used to change CSS properties for HTML elements.  For Ex :  $("p").css("background-color","yellow");
  • 11. jQuery Selectors  Few samples for the selectors Syntax Description $(this) Current HTML element $("p") All <p> elements $("p.intro") All <p> elements with class="intro" $(".intro") All elements with class="intro" $("#intro") The first element with id="intro" $("ul li:first") The first <li> element of each <ul> $("[href$='.jpg']") All elements with an href attribute that ends with ".jpg" $("div#intro All elements with class="head" inside a <div> element with .head") id="intro"
  • 12. jQuery Filters  First paragraph – p:first  Last list item – li:last  Fourth link – a:nth(3)  Fourth Div – div:eq(3)  Every other Paragraph – p:odd or p:even  Every link after/upto 4th – a:gt(3) or a:lt(4)  Links that contain word like click – a:contains(“click”)  All radio inputs with in first form - $(“input:radio”, documents.forms[0])
  • 13. jQuery Attributes  Read  $(#image).attr(“src”);  Set  $(#image).attr(“src” , “images/jquery1.jpg”);  Multiple Set  $(#image).attr({src: “images/jquery1.jpg” , alt: “jQuery”});  Set Class  $(p:last).addClass(“selected”);  Read/Set Html  $(#id).html() & $(#id).html(“value”);
  • 14. jQuery Events  The jQuery event handling methods are core functions in jQuery.  For Example  <html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("button").click(function(){ $("p").hide(); }); }); </script> </head> <body> <h2>This is a heading</h2> <p>This is a paragraph.</p> <p>This is another paragraph.</p> <button>Click me</button> </body></html>
  • 15. jQuery Callback Functions  A callback function is executed after the current animation (effect) is finished.  Syntax  $(selector).hide(speed,callback)  For Ex:  $("p").hide(1000,function(){ alert("The paragraph is now hidden"); });
  • 16. jQuery HTML Manipulation  jQuery can manipulate the HTML elements and attributes  Changing HTML Content  $(selector).html(content)  Adding HTML content  $(selector).append(content)  $(selector).prepend(content)  $(selector).after(content)  $(selector).before(content)
  • 17. jQuery HTML Manipulation  jQuery HTML Manipulation Methods Function Description $(selector).html(content) Changes the (inner) HTML of selected elements Appends content to the (inner) HTML of selected $(selector).append(content) elements $(selector).after(content) Adds HTML after selected elements
  • 18. jQuery CSS Manipulation  jQuery css() Method  css(name) - Return CSS property value  css(name,value) - Set CSS property and value  css({properties}) - Set multiple CSS properties and values  Examples  Return CSS Property  $(this).css("background-color");  Set CSS Property & value  $("p").css("background-color"," yellow");  Set Multiple values in CSS  $("p").css({"background-color":"yellow","font-size":"200%"});  Size Manipulation  $("#div1").height("200px"); $("#div2").width("300px");
  • 19. jQuery CSS Manipulation  Offset  $(this).offset().left  $(this).offset().top  Position  $(this).position().left  $(this).position().top
  • 20. jQuery CSS Manipulation  jQuery CSS Manipulation Methods CSS Properties Description Get the style property value of the first $(selector).css(name) matched element Set the value of one style property for $(selector).css(name,value) matched elements Set multiple style properties for $(selector).css({properties}) matched elements $(selector).height(value) Set the height of matched elements $(selector).width(value) Set the width of matched elements