<p>12345678901sw</p>
var circleList;
var isPhone = /\d{11}/g;
circleList = $("p").html();
var arrPhone = circleList.match(isPhone);
console.log(arrPhone);
circleList = circleList.replace(isPhone, function(word) {
return ‘<a href="tel:‘ + word + ‘">‘ + word + ‘</a>‘;
})
$("p").html(circleList);
时间: 2024-10-23 13:49:22