jQuery add text to span within a div

后端 未结 3 1859
感动是毒
感动是毒 2020-12-23 16:28

How would I do to add some text within the span like code below ?

<
3条回答
  •  北海茫月
    2020-12-23 16:36

    You can use append or prepend

    The .append() method inserts the specified content as the last child of each element in the jQuery collection (To insert it as the first child, use .prepend()).

    $("#tagscloud span").append(second);
    $("#tagscloud span").append(third);
    $("#tagscloud span").prepend(first);
    

提交回复
热议问题