Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Ajax Jquery Use of jQuery attribute filters

Related Tutorials


 
 

Share on Google+Share on Google+

Use of jQuery attribute filters

Advertisement
Using jQuery attribute filters make it easy to select and modify particular attributes in your html DOM

Use of jQuery attribute filters

     

Use of jQuery attribute filters

In this section you will learn how to use attribute filters of jQuery.

Using jQuery attribute filters make it easy to select and modify particular attributes in your html DOM. So, you can find the elements based on some query and then modify them to suit your application needs.

Given below is the demonstration how you can apply filters on attribute ,here we are using "a href " attribute of html DOM :

  • Using it , you can hide all the link in your html page as : $("a[href]").toggle();.
  • But if you want to hide one link , you can do it as : $("a[href='http://www.ai.com/']").toggle();
  • If you want to hide the link which has "google" in href.
  • You can also hide the links which ends with "org" as  $("a[href$='org']").toggle();
  • You can also hide the link which starts like " http://doc " as : $("a[href^='http://docs']").toggle();.

Learn from experts! Attend jQuery Training classes.

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: September 15, 2010

Related Tutorials

Discuss: Use of jQuery attribute filters  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:1
Zavrina
July 3, 2011
UbRqSdlUAUITDQKqKBu

Articles like this are an example of quick, helpful aswners.
DMCA.com