I'm adding a search system in JS to my website but it is going wrong. I made an if statement to open another file on my website when the word "music" is the text inside the search bar. I also made another if statement to open youtube.com when youtube is searched. but, when I search youtube, it opens up the file made to open when the search is music. There are no errors. This is the JS code for the if statements and the HTML code for the search bar:
<script>
function Searchprocessor() {
if(hfrrfsunehdsurhmurh == "music" || "MUSIC" || "Music" ){
window.location.replace("search_results/search_music.html");
}
else if(hfrrfsunehdsurhmurh == "Youtube" || "YOUTUBE" || "youtube" || "YouTube"){
window.location.replace("https://www.youtube.com");
}
}
</script>
<img style="position:absolute; top:0px; right:670px;" src ="images/t.png" height="100">
<input type="text" id="hfrrfsunehdsurhmurh" style="position:absolute; top:110px; right:650px;" placeholder="Search something">
Please help me get it working.