html select option separator
The disabled option approach seems to look the best and be the best supported. I've also included an example of using the optgroup.
optgroup (this way kinda sucks):
<select> <optgroup> <option>First</option> </optgroup> <optgroup label="_________"> <option>Second</option> <option>Third</option> </optgroup></select>
Adding separator between arrow icon and text in select
Wrap the select in another DIV (eg. custom-select-wrapper
) and use a CSS psuedo element for the border...
https://www.codeply.com/go/edxDmWNLx6
<div class="custom-select-wrapper">
<select classs="custom-select">
<option>opt1</option>
<option>opt2</option>
<option>opt3</option>
</select>
</div>
CSS
.custom-select-wrapper {
position: relative
}
.custom-select-wrapper:after {
border-left: 2px solid #ccc;
content:"\00a0";
position: absolute;
top: 0;
right: 46px;
z-index: 2;
display:block;
height: 38px;
}
Display HTML Select box Based on Selecting Option From Other Select box Noob Question
On line 20-27, you have a multiline string with "
quotes. You can't create multine strings using "
in JS without adding \
to the end of each line. So simply replace the "
with `
where you need to create a multi-line string like this: x.innerHTML = `<label for="carsyo">Choose a yingyang</label>
The better option would be to include the second select directly in your HTML and show/hide it like this.
Unable to show HTML select option initially when starting the page in Angular
you should fill statusFilter with "Choose" value in the "ts" file.
statusFilter = 'Choose';
Related Topics
Background Video with 100% Width and Fixed Height
Make an Image Width 100% of Parent Div, But Not Bigger Than Its Own Width
@-Moz-Document Url-Prefix() Not Working
How to Center Multiple Divs Inside a Container in CSS
HTML - Two Tables Side by Side
CSS Border Color Switch Animation: "From" Color Not Correct
Can You Tab Through All Radio Buttons
How to Align Text Directly Beneath an Image
How to Have Quotation Marks in HTML Input Values
@Font-Face Not Working with Specific Version of Internet Explorer 11
Why Isn't Position:Sticky with Left:0 Working Inside a Scrollable Container
Anchor <A> Tags Not Working in Chrome When Using #
Mobile Website "Whatsapp" Button to Send Message to a Specific Number
CSS Box Shadow Around a Custom Shape
Svg Lineargradient Hidden If Svg Is Hidden in Seperate Class