Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#8916 closed bug (duplicate)

attr('list') return the datalist element, not the attribute value

Reported by: [email protected] Owned by:
Priority: low Milestone: 1.next
Component: attributes Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:


With this type of markup :

<input type="text" list="choices"> <datalist id="choices">

<option value="choice">choice</option>


And this jquery code :


On FF4 and Opera (which implement <datalist>) : This call return <datalist id="choices"> and not "choices". So it's impossible to change the attribute value. It's important to note that "$('input')[0].list" returns also the datalist element and not the attribute value.

On other browsers (which do not implement <datalist>) : This call return "choices", the attribute value.

For me it's a bug because it differs from all element attributes value get. But with FF4 and Opera behaving in a similar way it can be spec related.

Change History (2)

comment:1 Changed 12 years ago by Timmy Willison

Component: unfiledattributes
Priority: undecidedlow
Resolution: duplicate
Status: newclosed

Thanks for taking the time to contribute to the jQuery project!

This has been fixed in the upcoming jQuery 1.6. http://jsfiddle.net/timmywil/L3V9z/

comment:2 Changed 12 years ago by Timmy Willison

Duplicate of #8255.

Note: See TracTickets for help on using tickets.