Bug Tracker

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#10908 closed bug (invalid)

makeArray it's duplicate entries!

Reported by: [email protected] Owned by:
Priority: low Milestone: None
Component: core Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:



Jsfiddle Example

If you saw with atention, you will see that print twice "um" in ul list html.

Change History (3)

comment:1 Changed 11 years ago by sindresorhus

It's not a bug, you're just using it wrong.

jQuery finds the value of the first input it encounters that is a descendant of a <li>. In this example, the <li>s are parent and child. In both <li>s the input with the value "test" is the first it finds.

<li class="parent">
		<li class="child">
			<input value="test">

You should instead do something like this:


$('.ulList li input').each(function(i) {
   console.log( 'inputVal', $(this).val(), i );

comment:3 Changed 11 years ago by sindresorhus

Resolution: invalid
Status: newclosed

comment:4 Changed 11 years ago by sindresorhus

Component: unfiledcore
Priority: undecidedlow
Note: See TracTickets for help on using tickets.