HTML Editor
<!DOCTYPE html> <html lang="en-US"> <body> <p>Return "true" if a search string finds a match, else, false.</p> <button onclick="myFunction()">Click me</button> <p id="point"></p> <script> function myFunction() { var str = "Pot I got is hot"; var pattern = new RegExp("o"); var result = pattern.test(str); document.getElementById("point").innerHTML = result; } </script> </body> </html>
OUTPUT
×

Save as Private