Solved

Getting Repeater Item in Jquery

Posted on 2010-08-28
2
874 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 500 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
This article discusses how to create an extensible mechanism for linked drop downs.
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)
Suggested Courses

624 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