Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Addclass to element of object

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
insert text field data into html script 13 45
MVC5 - Two different JQuery libraries are loading???? 2 25
Jquery keyup 4 25
Generate Numbers in JQuery file 11 66
by Julian Matz As of jQuery (http://jquery.com/) 1.4 the .live() method (http://api.jquery.com/live/) supports custom events as well as some standard JavaScript events that it previously didn't support. Among these is the submit event. Unlike …
What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

839 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