0

I need to get the longdesc from an image.

I have tried:

$(this).prop('longdesc'); 

but it returns undefined.

User970008
  • 1,135
  • 3
  • 20
  • 49

2 Answers2

0

You can use data-* attributes, and get the data using .data()

http://api.jquery.com/jQuery.data/

Populus
  • 7,470
  • 3
  • 38
  • 54
0

just for the sake of an answer:

Use attr() instead of prop()

Jake Zeitz
  • 2,429
  • 3
  • 23
  • 43