jQuery: Finding duplicate ID's and removing all but the first

前端 未结 8 1553
天涯浪人
天涯浪人 2020-12-13 20:57
    $(\'[id]\').each(function () {

        var ids = $(\'[id=\"\' + this.id + \'\"]\');

        // remove duplicate IDs
        if (ids.length > 1 && id         


        
8条回答
提交回复
热议问题