JSFiddle - React, Tailwind, and code Playground

by TheFiddler

HTML

<button id="go">Check</button>
<div id="result">:</div>

JavaScript

$("#go").click(function() {

var locText ="blog.step2.com";
 
    var step2Domain = new RegExp('www.step2.com', 'i');
    var step2Redirect = new RegExp('^step2.com', 'i');


    if(step2Domain.test(locText) || step2Redirect.test(locText)){
    
     
    $("#result").html('<p>Yes</p>');
    }
    else{
         $("#result").html('<p>No</p>');
    }
});