Select all elements with class name start by specific string by jquery

后端 未结 2 1751
南方客
南方客 2021-01-07 12:06

This is my HTML DOM:

Goola1

volaa
2条回答
  •  滥情空心
    2021-01-07 12:54

    $('div').filter(function() {
      return $(this).has('span[class^="yak-bak"]');
    }).remove();
    

    DEMO

    Or

    $('div').filter(function() {
      return $(this).has('span[class^="yak-bak"], span[class*=" yak-bak"]');
    }).remove();
    

    But First one will enough.

提交回复
热议问题