Skip to main content

Bug Tracker

Side navigation

#11247 closed bug (invalid)

Opened January 27, 2012 08:22PM UTC

Closed January 27, 2012 08:52PM UTC

Will not grabb "a" as attribute.

Reported by: szczepan.krol@gmail.com Owned by:
Priority: low Milestone: None
Component: attributes Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:
Description

$('select').change(function(){

var b=$(this+':selected').parent().attr('a')

var c=$(this+':selected').attr('c')

alert('book: '+b+' chapter:'+c)

})

will not grabb "a" as attribute.

If a rename the attribute to "b" it works.

http://jsfiddle.net/v2gLS/1/

Attachments (0)
Change History (2)

Changed January 27, 2012 08:36PM UTC by szczepan.krol@gmail.com comment:1

Replying to [ticket:11247 szczepan.krol@…]:

$('select').change(function(){ var b=$(this+':selected').parent().attr('a') var c=$(this+':selected').attr('c') alert('book: '+b+' chapter:'+c) }) will not grabb "a" as attribute. If a rename the attribute to "b" it works. http://jsfiddle.net/v2gLS/1/

sorry! this i the right URL:

http://jsfiddle.net/v2gLS/2/

Changed January 27, 2012 08:52PM UTC by timmywil comment:2

component: unfiledattributes
priority: undecidedlow
resolution: → invalid
status: newclosed

a is not an attribute present on the element. Also, a would be an invalid attribute. I recommend using data-* attributes for custom data.