JavaScript Program to Check Regular Expression using test() method

Write a JavaScript program to check regular expression using test() method.

Source Code
    <title>Regular Expression using test() method</title>
        function checkRE()
            var text = document.getElementById('input').value
            var regex = /abc/
            var res = regex.test(text)
            document.getElementById('panel').innerHTML = res
Enter text <input type="text" id="input"/>
<input type="button" value="Check" onclick="checkRE()"/>
<p id="panel"></p>

"Coding Hub - Learn to code" app now available on Google Play Store