Javascript add a tag to http url word (http url 에 a tag 추가)

function addATagToHttpUrl(text) {
return text.replace(/\bhttp\S+/g, function (x) {
return "<a target='_blank' href='" + x + "'>" + x + "</a>";
});
}

댓글

이 블로그의 인기 게시물

mongoDB admin 권한 설정방법 How to enable access control for mongo DB

Install pm2 via yarn globally

Install node and yarn on Linux