How can i format the text in a bootstrap select i.e.
Select1.addItem("<b>Title</b><br><small>Sub text</small>") = Dont work
Select1.addItem(<b>+"Title"+</b><br><small>+"Sub text"+</small>) = Dont work
How can i format the text in a bootstrap select i.e.
Select1.addItem("<b>Title</b><br><small>Sub text</small>") = Dont work
Select1.addItem(<b>+"Title"+</b><br><small>+"Sub text"+</small>) = Dont work
.innerHTML also doesn’t work.
You’ll need to navigate through the DOM to get to the actual < option > tag and style it or change its innerHTML.
I tried that by editing it in the console but it didnt work, all the html tags are shown as text or ignored.
Did some Googling and found a lot of Stack Overflow discussions around it. The behavior is somewhat browser dependent and just a few styling options work with the OPTION tag. In my app I could customize “font-size; background-color; color”.
Thank you. I might need to find another way of doing it rather than using a select.
You have probably already solved this, but in my app I found I had to put quotes around the <> as.
"<B>" &
In my case this works fine. note size has to precede the bold.
Listgroup1.addItem(Trim(title(x) & "<small>" & "<B>" & WX & "</B></small>" & "<br>" & hdgdist(x)))