Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
画像からlongdescを取得する必要があります。
私が試してみました:
$(this).prop('longdesc');
ただし、undefinedを返します。
data-*属性を使用し、を使用してデータを取得できます.data()
data-*
.data()
http://api.jquery.com/jQuery.data/
答えのためだけに:
attr()の代わりに使用prop()
attr()
prop()