Answers for "link in html to go to a tag"

0

how to make html open link in new tab

<!DOCTYPE html>
<html lang="en">
<head>
    <title>Document</title>
</head>
<body>
    <a href="INSERT LINK" target="_blank">NAME</a>
</body>
</html>

// code by Tyler100OOO (Twitter @TylerCode1)
Posted by: Guest on March-13-2020
0

js replace text link with anchor tags

var exp_match = /(\b(https?|):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
   var element_content=content.replace(exp_match, "<a href='$1'>$1</a>");
   var new_exp_match =/(^|[^\/])(www\.[\S]+(\b|$))/gim;
   var new_content=element_content.replace(new_exp_match, '$1<a target="_blank" href="http://$2">$2</a>');
Posted by: Guest on February-20-2020

Browse Popular Code Answers by Language