我有很多图像的视图
<img src="@Path" data-img-prev="@UrlPreview" data-full-path="@UrlImage" onclick=Get() />
它像这样在html中呈现
<img img-prev="1.jpg" data-full-path="https://...1.jpg" src="https://...1.jpg">
<img img-prev="2.jpg" data-full-path="https://...2.jpg" src="https://...1.jpg">
<img img-prev="3.jpg" data-full-path="https://...3.jpg" src="https://...1.jpg">
我想要函数从每个元素中获取数据
function Get() {
this.getAttribute('img-path');
this.data('img-path');
}
它不起作用请帮助:
错误 this.getAttribute 不是函数