Loop through an array of songs using JS. If song is in the array, alert "Yes". If it's not, alert "No"
<p>I'm trying to display a list of songs my band plays on a new website. The user enters a song name (in the input tag called "liveSearchBox") and clicks the "findSong" button. If we play the song, I want to alert "Yes, we play it!". If we don't, I want to alert "Sorry, we don't play it." I've been trying for hours to figure out the solution, but am not advanced enough yet. Thanks for any help! </p>

<p>Here's my HTML code: </p>

<pre><code>&lt;div class="live-search-list"&gt;

    &lt;input type="text" id="liveSearchBox" placeholder=" Search Songs or Artist"&gt;
    &lt;button id="findSong"&gt; Click to Find!&lt;/button&gt;
    &lt;ul id="songList"&gt;
        &lt;li class="song"&gt; Margaritaville&lt;/li&gt;
        &lt;li class="song"&gt; Boys of Summer&lt;/li&gt;
        &lt;li class="song"&gt; Somebody Like You&lt;/li&gt;
    &lt;/ul&gt;

&lt;/div&gt;
</code></pre>

<p>And here's my Javascript:</p>

<pre><code>var songList = ["Margaritaville","Boys of Summer","Somebody Like You"];
var findButton = document.getElementById("findSong");
var songQuery = document.getElementById("liveSearchBox");
var songListItem = document.getElementsByClassName("song");

findButton.onclick = function(){
   for (var i = 0; i&lt;songList.length; i++){
       if (songQuery.value === songList[i]){
           alert('Yes, we play "' +  songQuery.value + '"!');
       }  else {
             i++;
          }

  } 

};
</code></pre>