Bug Tracker

Opened 7 years ago

Closed 7 years ago

#13179 closed bug (notabug)

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

Change History (1)

comment:1 Changed 7 years ago by dmethvin

Resolution: notabug
Status: newclosed

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

Note: See TracTickets for help on using tickets.