Solved

Addclass to element of object

Posted on 2013-05-19
3
211 Views
Last Modified: 2013-05-19
Hello experts.
I need help to add a class to a tags aof an element
//par is the div container object
var par = $(this).parent();

Now i need to add "top" class to the 'a' tags inside the 'par' object

Any help?
0
Comment
Question by:Panos
  • 2
3 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 39178419
$("a", par).addClass("top");

or :

par.find("a").addClass("top");
0
 
LVL 2

Author Closing Comment

by:Panos
ID: 39178421
Thank you very much
regards
panos
0
 
LVL 82

Expert Comment

by:leakim971
ID: 39178426
You're welcome! Have a nice sunday!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

DOM Attributes and Properties treatment with jQuery 1.6 by Ivo Stoykov jQuery (http://jquery.com/) 1.6 introduces .prop() (http://api.jquery.com/prop/) and .removeProp() (http://api.jquery.com/removeProp/) methods which allow modifying or removi…
How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now