Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Getting Repeater Item in Jquery

Posted on 2010-08-28
2
Medium Priority
?
875 Views
Last Modified: 2013-11-11
Hi Experts

I do have a repeater and a link within the repeater in that for collapsing/expanding the repeater items.I want to collapse the respective div when the link is clicked. How do i get the id of the div when the link is clicked,i mean if i click the repeater second item link i want the div id of second row.
0
Comment
Question by:manishk1111
[X]
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
2 Comments
 
LVL 15

Accepted Solution

by:
SRigney earned 1500 total points
ID: 33549416
Do you have some html you can post to help out?

You should be able to attach to the links and get the id of the parent div. like this. if the links in the repeater have a class of repeaterLinks.

$(".reapeaterLinks").click(function() {
  $link = $(this);
  // get the closest parent that is a div then get it's id.
  $link.parents("div").attr(*id");
});
0
 

Author Closing Comment

by:manishk1111
ID: 33710324
Solution was partially helpful.
0

Featured Post

Setting up LaraDock for Laravel

Learn how to set up LaraDock in a Laravel project - LaraDock gives us an easy way to run a Laravel application using Docker in a single command.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to dynamically set the form action using jQuery.
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…
Suggested Courses

721 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