Reverse order words in a dynamic sentence

后端 未结 2 1277
温柔的废话
温柔的废话 2021-01-29 03:40

I have several tags like this:

1 Comment

I would like to do this reversing the order of the

2条回答
  •  时光取名叫无心
    2021-01-29 04:44

    try this.

    $('.classCover').each(function(){
    
        var link = $(this).text().split(' ');
        $(this).text(link[1] + "(" + link[0] + ")");
    });
    

提交回复
热议问题