Get attributes from the rel attribute with jQuery

后端 未结 3 2012
名媛妹妹
名媛妹妹 2021-01-23 14:31

Im using a plugin that requires the rel-element to look like this.

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-23 14:44

    Here is one way:

    $("#product-thumbs-list a").each(function(index) {
       var arrTemp = $(this).attr("rel").split("smallImage: ");
       var value = arrTemp[1];
       alert(value);
    });
    

    Live test case.

提交回复
热议问题