How to get elements of specific class starting with a given string?

后端 未结 11 883
面向向阳花
面向向阳花 2021-02-03 21:19

I have a list of elements that have multiple classes, for example:


         


        
11条回答
  •  时光取名叫无心
    2021-02-03 21:48

    It would probably be better to store those values in the data attribute:

    
    
    
    

    Then:

     $(".etape").click(function(){
         var myBtnType = $(this).data('btntype');
     });
    

    jsFiddle

提交回复
热议问题