Вопрос

I need to get the longdesc from an image.

I have tried:

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

but it returns undefined.

Это было полезно?

Решение

just for the sake of an answer:

Use attr() instead of prop()

Другие советы

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

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top