String match(): returns the text if found
<html> <body> <script type="text/javascript"> var str = "Javascript is great!" document.write(str.match("great")) </script> </body> </html>