用jquery给li标签加上id

2025-03-26 21:49:39
推荐回答(1个)
回答1:

$('.multiselect').children('li').each(function(i){
    $(this).attr('id','id_'+(i+1));
});