Custom select element in html form

This might be a really basic html question. but for custom elements, like if i were implementing a custom select element (dropdown), how does one get the value? or bubble it up to the form? for example an element like this https://codepen.io/tiotolstoy/pen/wvKKoQG?editors=1010