I've got a slider on my main page that displays a picture and some text. After a few seconds, the picture changes and so does the text.

What I want to do is that when someone clicks on the text, it goes to the corresponding page.

For example: If the text is Chocolate, go to chocolate.php. Else if it's Vanilla, go to vanilla.php

However, with my current code, it always goes to chocolate.php no matter what the text says.

```
   walk:function(step) {
     $('#type').text(type_value[step]).on('click', function(){
          var selection = $('type').text(type_value[step]).value;
            if(selection = 'Chocolate') {
                window.location = 'selection/chocolate/';
                return false;
                } else if (selection = 'Vanilla') {
                window.location = 'selection/vanilla/';
                return false;
                }
            });
          }

```

I've also tried:

```
 walk:function(step) {
   $('#type').text(type_value[step]).click(function(){
      var selection = $('#type').text(type_value[step]).value;
        if(selection = 'Chocolate') {
            window.location = 'selection/chocolate/';
            return false;
        } else if (selection = 'Vanilla') {
            window.location = 'selection/vanilla/';
            return false;
            }
        });

```

Another thing I tried was without using var selection. Checking value directly in if statement instead.

Please let me know if you are confused by something, and I will be more than happy to clarify.

Thank you very much for your time, and for your help.