Show all “title” tooltips at once on one page

前端 未结 2 1191
故里飘歌
故里飘歌 2021-01-26 07:33

Thank you for the answers. I edited my question though: I\'m trying to show all the tooltips on the page itself. And there are too many

tags on the page

2条回答
  •  萌比男神i
    2021-01-26 08:23

    Easy way, check this out.

    HTML:

    JS:

    var all_title = "";
    
    $("body").find('p[title]').each(function() {
        all_title += $(this).attr('title') + " ";
    });
    $('p.display_all_title').html(all_title);
    

    JsFiddle: https://jsfiddle.net/fhepoeb5/

提交回复
热议问题