Finding matched classname in jQuery

后端 未结 4 1714
执念已碎
执念已碎 2021-02-13 18:54

I have a series of image thumbnails in a page. They are created using css sprites.

4条回答
  •  臣服心动
    2021-02-13 19:30

    Surprised nobody ever mentioned data attributes as a solution.

    More verbose and clearer and you can put whatever you want for the value.

    With jQuery you can get the value with $(ele).data('imagename')

提交回复
热议问题