Prev Demo
If Match Is Not Found In A String In Javascript.
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <h1>If search is not found.</h1> <p>Click the below button to search for a Match.</p> <input type="button" value="Match" onclick="Function()" /> <p id="myId"></p> <script> function Function() { var a = "DotNetFunda was introduced in 2007, TechFunda in 2015, ITFUNDA in 2011, myFunda.net is a part of ITFUNDA"; var r = a.match(/can/g); document.getElementById("myId").innerHTML = r; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output