Javascript: only execute a function if body class is exist : I have a body class like this:

    <body class="horizontal">

I try to target with the following code:

    'use strict';

    (function() {
      if(document.body.className === 'horizontal') {
        alert('It exists');
      };
    })();

But this is just not working. The `alert` not popping up. I would like to prefer a pure javascript solution, to not include Jquery because of this.