Bug Tracker

Modify

Ticket #11691 (closed bug: worksforme)

Opened 13 months ago

Last modified 13 months ago

.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:
Blocking: Blocked by:

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

comment:1 follow-up: ↓ 2 Changed 13 months ago by rwaldron

  • Status changed from new to closed
  • Resolution set to worksforme

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 13 months 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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.