#8916 closed bug (duplicate)
attr('list') return the datalist element, not the attribute value
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | attributes | Version: | 1.5.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
With this type of markup :
<input type="text" list="choices"> <datalist id="choices">
<option value="choice">choice</option>
</datalist>
And this jquery code :
$('input').attr('list')
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
Component: | unfiled → attributes |
---|---|
Priority: | undecided → low |
Resolution: | → duplicate |
Status: | new → closed |
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/