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');
但它返回未定义。
只是为了回答:
使用attr()代替prop()
attr()
prop()
您可以使用data-*属性,并使用获取数据.data()
data-*
.data()
http://api.jquery.com/jQuery.data/