Bug Tracker

Opened 12 years ago

Closed 12 years ago

#8071 closed bug (worksforme)

jQuery Core

Reported by: [email protected] Owned by: [email protected]
Priority: undecided Milestone: 1.next
Component: unfiled Version: 1.4.1
Keywords: Cc:
Blocked by: Blocking:

Description (last modified by addyosmani)

<!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 (2)

comment:1 Changed 12 years ago by addyosmani

Description: modified (diff)
Owner: set to [email protected]
Status: newpending

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).

comment:2 Changed 12 years ago by jitter

Resolution: worksforme
Status: pendingclosed

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.


How to report bugs

Note: See TracTickets for help on using tickets.