Skip to main content

Bug Tracker

Side navigation

#11691 closed bug (worksforme)

Opened May 03, 2012 05:37PM UTC

Closed May 03, 2012 06:17PM UTC

Last modified May 03, 2012 06:25PM UTC

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

Reported by: lcouto87@gmail.com 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

Attachments (0)
Change History (2)

Changed May 03, 2012 06:17PM UTC by rwaldron comment:1

resolution: → worksforme
status: newclosed

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

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

Changed May 03, 2012 06:25PM UTC by anonymous comment:2

Replying to [comment:1 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.