Skip to main content

Bug Tracker

Side navigation

#8071 closed bug (worksforme)

Opened January 27, 2011 06:13AM UTC

Closed January 27, 2011 08:45PM UTC

jQuery Core

Reported by: vemuhemanthkumar@gmail.com Owned by: vemuhemanthkumar@gmail.com
Priority: undecided Milestone: 1.next
Component: unfiled Version: 1.4.1
Keywords: Cc:
Blocked by: Blocking:
Description
<!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>
Attachments (0)
Change History (2)

Changed January 27, 2011 06:18AM UTC by addyosmani comment:1

description: \ {{{ \ <!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> \ }}} \ {{{ \ <!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> \ }}} \
owner: → vemuhemanthkumar@gmail.com
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).

Changed January 27, 2011 08:45PM UTC by jitter comment:2

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