Modify ↓
Ticket #8071 (closed bug: worksforme)
jQuery Core
| Reported by: | vemuhemanthkumar@… | Owned by: | vemuhemanthkumar@… |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.next |
| Component: | unfiled | Version: | 1.4.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description (last modified by addyosmani) (diff)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="http://docs.jquery.com" />
<title>index(subject) function</title>
<style type="text/css">
.div_style
{
background-color: Aqua;
font-family: Verdana;
font-size: small;
}
</style>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.1.js" />
<script type="text/javascript">
$(document).ready(function () {
$("div.div_style").click(function () {
//This is the DOM element clicked
var index = $("div").index(this);
$("span").text("That was div index #" + index);
});
});
</script>
</head>
<body>
<span></span>
<br />
<div class="div_style ">
First Div
</div>
<br />
<div class="div_style ">
Second Div
</div>
<br />
<div class="div_style ">
Third Div
</div>
<br />
</body>
</html>
Change History
comment:1 Changed 2 years ago by addyosmani
- Owner set to vemuhemanthkumar@…
- Status changed from new to pending
- Description modified (diff)
comment:2 Changed 2 years ago by jitter
- Status changed from pending to closed
- Resolution set to worksforme
Following the code-blob you pasted in the ticket I made this test case
I can't see anything obviously wrong with this.
If you still think there is a bug please submit a reduced test case, which reproduces the issue you are experiencing, on http://jsfiddle.net. So that we can investigate this issue further. Also include a useful description detailing what you think isn't working as expected.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Can you please explain what the particular bug or issue you're experiencing is? 'jQuery Core' doesn't give us a lot to go on at the moment. Thanks! (Please also remember to use a recent version of jQuery (1.4.4 or 1.5RC1) when testing as your test includes an old release).