One of the features in my Shiny app is a select menu which is represented in the code snippet below.
selectInput(
"mySelectMenu",
"",
c(1,2),
selected = NULL,
multiple = FALSE
)
I have set up actions to be triggered on this element as shown below
observeEvent(input$mySelectMenu,{
currentIndividual<-as.numeric(input$mySelectMenu)
toggleFunction(currentIndividual)
},ignoreInit=TRUE)
Upon inspecting the element, I can view the div containing the dropdown content. The HTML structure appears like this
<div class="selectize-dropdown-content">
<div data-value="1" data-selectable="" class="option selected">318_2007</div>
<div data-value="2" data-selectable="" class="option">320_2007</div>
<div data-value="3" data-selectable="" class="option">321_2007</div>
<div data-value="4" data-selectable="" class="option">344_2009</div>
<div data-value="5" data-selectable="" class="option">346_2009</div>
<div data-value="6" data-selectable="" class="option">355_2009</div>
</div>
The visual representation can be seen in the image at this link: https://i.sstatic.net/ojo2o.jpg
In certain scenarios, I want to change the appearance of specific menu items. For example, I want the div with 'data-value="2"' to have BOLD RED text. How can I add or remove the CSS class (.menuItemInactive) from this specific div? I am already utilizing shiny.js and am open to using it or any other appropriate package for this customization.
.menuItemInactive{
font-weight:bold;
color:red;
}