Bug Tracker

Opened 8 years ago

Closed 8 years ago

#11247 closed bug (invalid)

Will not grabb "a" as attribute.

Reported by: szczepan.krol@… 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/

Change History (2)

comment:1 in reply to:  description Changed 8 years ago by szczepan.krol@…

Replying to 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/

comment:2 Changed 8 years ago by timmywil

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.

Note: See TracTickets for help on using tickets.