hi, i m working on a field that is of url. i am unable to use regex as i am new to JS, how can i use regex in my following condition
Code JavaScript:
var website = $('#website').val();
    if(website=='') {
        $("#website").after('<span class="error">Enter website.</span>');
        hasError = true;
        }
    else if(!urlReg.test(website)) {
            $("#website").after('<span class="error">Website should be in [url]http://www.website.com[/url] format.</span>');
            hasError = true;
        }
for now. it go with any .com or if i enter .123 etc. help pls