Home Ajax Jquery Use of jQuery attribute filters



Use of jQuery attribute filters
Posted on: September 15, 2010 at 12:00 AM
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.

Related Tags for Use of jQuery attribute filters:


More Tutorials from this section

Ask Questions?    Discuss: Use of jQuery attribute filters  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.