Why my javascript if condition is not working? : I just write the following code

    $("ul > li > a").click(function() {
       var value = $(this)[0].innerText;
       console.log(value);
       if(value == "Gallery") {
          console.log("a");
       } else {
          console.log("b");                  
       }
    });

First console log print Gallery. But if condition goes to else statement why it's happening i can't understand.

Please see this image.

[![enter image description here][1]][1]


  [1]: https://i.stack.imgur.com/3UIFc.png