ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Validate Http and Https Url using RegularExpression (Regex) in JavaScript<p>You have not created a RegExp object and hence don't see test method</p> <div class="demo_block"> <pre class="brush: xml">&lt;input type = &#34;text&#34; id = &#34;txtUrl&#34; value = &#34;http://www.aspforums.net&#34; /&gt; &lt;input type = &#34;button&#34; value = &#34;Validate&#34; onclick = &#34;Validate()&#34; /&gt; &lt;script type=&#34;text/javascript&#34;&gt; function Validate() { var regexp = new RegExp(&#34;^http(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\&#39;\/\\\+&amp;amp;%\$#_]*)?$&#34;); var url = document.getElementById(&#34;txtUrl&#34;).value; if (!regexp.test(url)) { alert(&#34;Not valid Url!&#34;); } else { alert(&#34;Valid Url!&#34;); } } &lt;/script&gt; </pre> </div> <p><a class="demo button orange btn btn-red">Demo</a></p>https://www.aspforums.net:443/Threads/101081/Validate-Http-and-Https-Url-using-RegularExpression-Regex-in-JavaScript/https://www.aspforums.net:443/Threads/101081/Validate-Http-and-Https-Url-using-RegularExpression-Regex-in-JavaScript/Sun, 16 Mar 2014 23:39:40 GMT