# Building a Better Multi-Select with Bootstrap

The select component is one of the most fundamentally frustrating components in HTML forms. This is what it looks like:

![Select with multiple](https://cdn.hashnode.com/res/hashnode/image/upload/v1744871522022/4e3d583a-0aad-464a-9625-138a273d7698.png align="center")

The code needed to collect the values from this object is also complicated. For most inputs you can get the value by calling .value. In this case you have to write your own code to get the value.

```javascript
var category = Array.from(category_select.options).filter(function (option) {
    return option.selected;
}).map(function (option) {
    return option.value;
});
```

### Styled Multi Select

Our solution needs to have two key features, the first is that it should be much better looking and second it should be easy to get the value. This is why I built the styled Multi Select which quickly shows all selected values, with a stylised drop down that matches the bootstrap style.

%[https://codepen.io/Cyber-and-me/pen/zxxYMZR] 

To get the value, you simply call the value function.

```javascript
sms.value
```

Conclusion:

I have used this extensively. To get a hold of this element you can get it from my github.

[Github](https://github.com/VishnuUnnikrishnan/HTMLComponents.git)
