我想在 Estimated Time of Arrival 之前插入 break 标签 谁能帮忙
<span class="avl">Excludes: Northern Territory, QLD Far North, QLD Regional, WA Regional, WA Remote Estimated Time of Arrival: 3-8 Business Days,</span>
最佳答案
您可以获得该特定跨度的文本,然后添加 <br>
出现的字符串旁边的标记,如图所示。
$(document).ready(function(){
var string = $(".avl").text();
var usingBreak = string.replace("Estimated Time of Arrival", "<br/>Estimated Time of Arrival");
$(".avl").html(usingBreak );
});
关于javascript - 我想在 Jquery 中的某些特定文本之前插入 <br>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33119157/