jquery get a custom (made up) Attribute value

前端 未结 3 1117
终归单人心
终归单人心 2021-01-13 12:08

I have a the following html piece :

&l
3条回答
  •  鱼传尺愫
    2021-01-13 12:52

    Take a look at jQuery custom selectors. Personally, I would use HTML5 data attributes for cases such as this which is already supported in jQuery.

    For whatever it's worth, considering the parameter I believe what are you trying to originally perform should be done like

    getComments = function(input) {
       fValue =     $(input).html( $(input).attr("store-id") );
       alert('the ID :'+fValue.html());
    
       }
    

提交回复
热议问题