如何使用 replaceWith 在 jQuery 中用换行符替换逗号?
var team1 = ["player1", "player2", "player3"]
当我将 team1 添加到表格中时,它会显示为这样
player1,player2,player3
所以我尝试使用 jQueryreplaceWith以某种方式用换行符替换逗号。
$(team1).replaceWith('<br>')
但这针对整个team1,我只想针对逗号或以某种方式添加换行符而不是逗号。
有任何想法吗?