JavaScript
  Home arrow JavaScript arrow Page 3 - jQuery Overview
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVASCRIPT

jQuery Overview
By: Dan Wellman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 7
    2009-02-11

    Table of Contents:
  • jQuery Overview
  • Library Components
  • Attributes
  • More jQuery Attributes

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    jQuery Overview - Attributes


    (Page 3 of 4 )

    Working with element attributes allows you to do many cool things with elements on your web pages; the attributes section of jQuery gives you the tools to work with elements and their attributes quickly, easily and without the frustration of any browser inconsistencies.

    The methods exposed by this section of the library include those for getting and setting element attributes, determining whether an element has a class, as well as adding, removing and toggling classes, getting and setting the inner HTML or text of an element and getting or setting element values.

    Traversing

    Navigating document elements, or walking the DOM as it is more commonly known, can be problematic when using naked JavaScript. With jQuery however, moving from one end of the page to the other couldn't be easier.

    The Traversing section contains methods for advanced filtering of already-selected collections of elements, with methods such as filter(), is(), not() and slice() among others. Finding specific elements based on their relationships to other elements (as opposed to using id or class selectors) is also made easy with methods like children(), find(), contents(), next(), prev(), parents() and siblings().

    Manipulating

    Once you have the element (either by selection or creation), putting it somewhere appropriate is made child's play with the manipulation section of the library. As well as the methods for setting inner HTML or text that we already saw, this section allows you to easily insert content at the start or end of other elements, before or after other elements or even wrap around other elements completely.

    You can also replace matched elements, remove them from the DOM completely or clone them, all with smoothness and panache! There are a lot of methods in the section, but it's easy to remember what does what thanks to the simplified API.

    CSS

    The CSS component provides a series of powerful tools for getting and setting any CSS property of any element or collection of elements. It offers an easy literal object-based approach to setting any arbitrary number of CSS properties.

    Other tools in this category include the width() and height() methods that we used in an earlier example, as well as a useful offset() method for obtaining the viewport-relative offset of any specified element.

    Events

    Any modern JavaScript library that wants to emerge as a leader needs to provide a cross-browser way of working with events, and jQuery does just that. It exposes methods for defining and firing custom events, as well as binding to standard DOM events.

    The real gem of this section, however, is the huge range of event helpers, which wrap standard DOM events in jQuery functionality, allowing you to easily react to things like clicks on particular elements with minimal code and no browser detection.

    More JavaScript Articles
    More By Dan Wellman


       · Hi,This article aims to familliarise developers that haven't used jQeury before....
     

    JAVASCRIPT ARTICLES

    - Comparing Fields and Customizing Error Messa...
    - Checking Numbers and File Extensions with jQ...
    - Validating Digits and Dates with jQuery`s Va...
    - Validating Ranges, Emails, and URLs with jQu...
    - More Uses for the jQuery Tooltip Plug-in`s b...
    - Building Image-Based Tooltips with the jQuer...
    - Using the jQuery Tooltip Plug-in`s bodyHandl...
    - Using Rangelength, Min and Max with the Vali...
    - Using Minlength and Maxlength with the Valid...
    - Modifying Tooltip Coordinates with the jQuer...
    - Applying a Fade Out Effect with the jQuery T...
    - Tracking Mouse Movements with the jQuery Too...
    - Checking Online Forms with the Validator jQu...
    - Nested JavaScript Functions as Objects
    - The jQuery Tooltip Plug-in







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek