Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html>
<head>
<script>
function myFunc() {
var str = "The best things in life are free";
var patt = new RegExp("n");
var res = patt.exec(str);
document.getElementById("div1").innerHTML = res;
}
</script>
</head>
<body>
<button onclick="myFunc()">click</button>
<hr>
<div>Result:</div>
<hr>
<div id="div1"></div>
</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.8K 507