JSFiddle - React, Tailwind, and code Playground

by KevinIsNowOnline

HTML

<a id="aatabLink" href="www.google.com"> General</a>
<a id="bbtabLink" href="www.google.com">Consumer Research Proposal</a>
<a id="cctabLink" href="www.google.com"> Date & Documents</a>
<a id="ddtabLink" href="www.google.com"> Additional Info</a>
<a id="eetabLink" href="www.google.com"> Report As</a>
<input type='text' placeholder='enter something here' id='sampleField'>

CSS

a:visited{
    color: 'blue';
}
a:{
    
}

JavaScript

var el = $('[id$="tabLink"]:not(:contains("Consumer Research Proposal"))');
console.log(el);

el.bind('click', function(e){
    if(validateCRPInput() === false){
        alert('booo!');   
         e.preventDefault();   
    }
});



var validateCRPInput = function() {
     if($('#sampleField').val() === ''){
     return false;
     }else{
         return true;
     }
}