<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-12-29 23:29:00