Toggles element state and sets CSS class to allow customizing the look of elements when disabled (very useful to differentiate them from enabled elements).

toggle_state_and_css(selector, class, condition)

Arguments

selector

[character(1)]
Query selector of the elements to target.

class

[character(1)]
Class to add when condition is not satisfied.

condition

[function(1)]
Function that takes no parameters and evaluates to either TRUE or FALSE.