title: why doesn't this class checking loop thing work?
body: <p>i made a code to have the uploader name, upload time and view count in youtube search results in one line again, like before.
  it works correctly until you search for a channel name. when a channel displays in the results, it has three 'yt-uix-sessionlink g-hovercard spf-link' classed elements instead of one. i wanted the code to skip the channels, thats why 3 is added to one variable(to skip the channel title, other channel title under it, and the channel picture), and 1 to other(thats the update time and video count of the channels, it has the same class as the upload time and view count of videos).
  that should only happen if the current array item has the 'yt-uix-tile-link' class too, since only channels displayed in results have the same classes i check in "elemss" and that too, on the top channel title which is instead of the video title.
  but it doesnt seem to work. it doesnt even run the alert. i tried checking its whole class attribute with </p>
  
  <pre><code>if(elemss[i+elemsss].className=='yt-uix-sessionlink yt-uix-tile-link yt-ui-ellipsis yt-ui-ellipsis-2 g-hovercard spf-link')
  </code></pre>
  
  <p>and it still didnt work.
  i just need to know why this doesnt work, it should just skip the channels but it doesnt. you can try this code on youtube search results, and it will probably work unless there is a channel in the results, or advertisement results(or maybe playlists).</p>
  
  <pre><code>function hasClass(element, cls) {
      return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') &gt; -1;
  }
  var elems = document.getElementsByClassName('yt-lockup-meta-info');
  var elemss = document.getElementsByClassName('yt-uix-sessionlink g-hovercard spf-link');
  var elemsss = 1;
  var elemssss = 0;
  var myElem = document.getElementById('sb-button-notify');
  if (myElem == null) elemsss = 0;//these two lines are here to skip the additional element that is only there if you are logged in
  for (var i = 0; i &lt; elems.length; ++i) {if (hasClass(elemss[i+elemsss],'yt-uix-tile-link')){elemssss=elemssss+1;elemsss=elemsss+3;alert('damn');}
  elems[i+elemssss].insertBefore(elemss[i+elemsss],elems[i+elemssss].firstChild);}
  </code></pre>