Solved

Addclass to element of object

Posted on 2013-05-19
3
219 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
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)

685 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