I can't find how to do this. All I see is questions how to check if any value is present not a specific one.
How can I check if a slash is present inside an input field? So for example: value="/" or value="test/test" should both trigger the check.
My input field:
<input class="form-control" id="pagename" type="text" name="pagename" required="">
My jquery:
$("body").on("change","#pagename",function(){
if($(this).val() == '/'){
console.log('slash is present');
}
});
I found something about regex but can't this be done in a simpler way?