i'm trying to check if my url contains the word brand. as you can see i put my url into the variable url and now i want to check if that variable contains the word brand and replace it. My only problem is that i can't seem to find the code to check if it contains the word brand.
How do i do this?
<button onclick="myFunction()">navigate</button>
<script>
function myFunction()
{
var url = document.URL;
if (window.location.href.match(brand))
{
alert('yes');
}
url = url.replace('.html','.php')
window.location.href = url;o
}
</script>