开发者

jquery - remove last div in a group

开发者 https://www.devze.com 2023-03-27 11:21 出处:网络
How can I remove the very last DIV identified by id begining with letters \"section\"(eg: \"section99\")

How can I remove the very last DIV identified by id begining with letters "section" (eg: "section99") in a DIV identified by id="groupA"

currentTab = "A";

$('#subPart').click(function() { 
    name = "#group" + currentTab;   
        ....

    $(something开发者_JAVA百科).remove();              
    return false;
        });   


Try This script

   $('#groupA').find('div[id^="section"]:last').remove();
0

精彩评论

暂无评论...
验证码 换一张
取 消