Skip to main content

Bug Tracker

Side navigation

#13179 closed bug (notabug)

Opened January 08, 2013 05:17PM UTC

Closed January 08, 2013 05:19PM UTC

Selector returns 1 instance, where N are present

Reported by: ENetArch Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.1
Keywords: Cc:
Blocked by: Blocking:
Description

Code Example:

<head>
<script type="text/javascript" language="javascript" src="../jquery/jquery-1.8.1.js"></script>

<body>
<table name="Tabs" id="Tabs" class="blank">
	<tr name="Tabs_TR" id="Tabs_TR" class="blank">
		<td name="Tabs_TD" id="Tabs_TD" class="tabActive">
			<a href="javascript:void(0);" <tr name="Tabs_A" id="Tabs_A" class="tabActive">option1</a>
		</td>
		<td name="Tabs_TD" id="Tabs_TD" class="tabInActive">
			<a href="javascript:void(0);" <tr name="Tabs_A" id="Tabs_A" class="tabInActive">option2</a>
		</td>
		<td name="Tabs_TD" id="Tabs_TD" class="tabInActive">
			<a href="javascript:void(0);" <tr name="Tabs_A" id="Tabs_A" class="tabInActive">option3</a>
		</td>
		<td name="Tabs_TD" id="Tabs_TD" class="tabInActive">
			<a href="javascript:void(0);" <tr name="Tabs_A" id="Tabs_A" class="tabInActive">option3</a>
		</td>
		<td name="Tabs_TD" id="Tabs_TD" class="tabInActive">
			<a href="javascript:void(0);" <tr name="Tabs_A" id="Tabs_A" class="tabInActive">option3</a>
		</td>
		<td name="Tabs_TD" id="Tabs_TD" class="tabInActive">
			<a href="javascript:void(0);" <tr name="Tabs_A" id="Tabs_A" class="tabInActive">option3</a>
		</td>
	</tr>
</table>
</body>
</head>

Using Chrome, the following was executed in the console:

$("TD").length .. returned 6

$(".tabActive").length .. returned 2

$(".tabInActive").length .. returned 10

>>> this is the error <<<

$("#Tabs_TD").length .. returned 1, should be 6

>>> this is the error <<<

$("td#Tabs_TD").length .. returned 6

Attachments (0)
Change History (1)

Changed January 08, 2013 05:19PM UTC by dmethvin comment:1

resolution: → notabug
status: newclosed

The ID attribute should be unique. Ask for help on a forum.