Question: I want to add the class `pink` to my select2 selectbox. It works with the option but not with the box:

```js
$("select").select2({
  templateResult: function (data, container) {
    if (data.element) {
      $(container).addClass($(data.element).attr("class"));
    }
    return data.text;
  }
});
```

```css
.yellow { background-color: yellow; }
.blue { background-color: blue }
.green { background-color: green }
.pink { background-color: pink }
```

```html
<link href="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.1/css/select2.css" rel="stylesheet"/>

<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.1/js/select2.js"></script>

<select class="select2 pink">
  <option value="AL" class="yellow">Alabama</option>
  <option value="AK" class="blue">Alaska</option>
  <option value="AZ" class="green" selected>Arizona</option>
</select>

<select class="select2">
  <option value="Something else" >Something else</option>
  <option value="Something else" >Something else</option>
  <option value="Something else">Something else</option>
</select>
```

The result I need:

[![enter image description here](https://i.stack.imgur.com/L0Kv8.png)](https://i.stack.imgur.com/L0Kv8.png)

Answer: 
You could also use CardAction.dialogAction and link every button to a beginDialogAction. 

```
let card = new builder.HeroCard(session)
    .title(title)
    .subtitle(subtitle)
    .buttons([builder.CardAction.dialogAction(session, 'dialogAAction', 'dataYouNeedInDialogA', 'ButtonTitleA'), builder.CardAction.dialogAction(session, 'dialogBAction', 'dataYouNeedInDialogA', 'ButtonTitleB')]);

let msg = new builder.Message(session)
    .attachments([card])

session.endDialog(msg); 
// use one of these two to either end the dialog and start a new one  or to stay in the current dialog and wait for user input
session.send(msg);

// don't forget to add the dialogs to your bot / library later in your code (outside your current dialog) 
bot.dialog('dialogA', dialogA); // initialized somewhere in your code
bot.dialog('dialogB', dialogB); 
bot.beginDialogAction('dialogAAction', 'dialogA');
bot.beginDialogAction('dialogBAction', 'dialogB', {
onSelectAction: (session, args, next) => {
    // you might want to clear the dialogStack if the button is pressed. Otherwise, if the button is pressed multiple times, instances of dialogB are pilled up on the dialog stack.
    session.clearDialogStack();
    next();
  }
});

```

In my opinion, this is the best way to achieve the behaviour you described so far. All buttons work whenever the user presses them, even if they scroll back in the conversation and press the same button again. The only trade-off is that you have to pass data to the new dialog and can not use dialogData throughout the whole flow. Nevertheless, I think it's worth it because ensures consistent UX throughout the usage of the bot. 

Hope this helps. You can build click and clack dialogs, link them to actions and pass the data that you need. The user would be able to press click, clack, click and the bot would still work. :)
Use a switch-case in the ResumeAfter function, in the default case send the user to the previous function.