jQuery: how to change tag name?

前端 未结 17 938
無奈伤痛
無奈伤痛 2020-11-28 07:37

jQuery: how to change tag name?

For example:


    $1

I need

$1
<
17条回答
  •  清歌不尽
    2020-11-28 08:29

    To replace the internal contents of multiple tags, each with their own original content, you have to use .replaceWith() and .html() differently:

    http://jsfiddle.net/kcrca/VYxxG/

提交回复
热议问题