Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#11691 closed bug (worksforme)

.prop() doesn't return datetime attribute from <time> element

Reported by: lcouto87@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:

Description

Tested with:

  • jQuery 1.6.4 and jQuery 1.7.2
  • Google Chrome (Version 20.0.1123.1 dev)
  • Safari (Version 5.1.5 (7534.55.3) )
  • Mozilla Firefox (12.0)

All tests were performed in MacOSX 10.7.3

jsFiddle test case

Case: Try to retrieve the attribute datetime value from a <time> element, using the jQuery.fn.prop() function

What to expect: The element current attribute's value

What happens: undefined is returned

Change History (2)

comment:1 Changed 7 years ago by Rick Waldron

Resolution: worksforme
Status: newclosed

datetime is not a DOM property, it's an attribute - so use attr()

http://jsfiddle.net/rwaldron/85MH9/

comment:2 in reply to:  1 Changed 7 years ago by anonymous

Replying to rwaldron:

datetime is not a DOM property, it's an attribute - so use attr()

http://jsfiddle.net/rwaldron/85MH9/

I could swear that it was available as a property, but you're right in fact. Sorry for the mistake.

Note: See TracTickets for help on using tickets.