Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function makeurl() {
var str = "https://net-raft.com"
var regex = /(http|https):\/\/(\w+:{0,1}\w*)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%!\-\/]))?/;
if(!regex .test(str)) {
alert("Please enter valid URL!");
} else {
document.getElementById('test').innerHTML= "<a href='https://net-raft.com' target='_blank'>" + str +"</a>"
}
}
</script>
</head>
<body>
<div id="test">net-raft.com</div></br>
<button onclick="makeurl()">create</button>
</body>
</html>
The most helpful JAVASCRIPT solutions
How can I get the last day and the next day in javascript ?JAVASCRIPT Click to see more ... 5.9K 508