In my JavaScript application, there is a functionality that loads a list of items for users to click and view detailed information in a separate div on the page. Users should be able to interact with and make modifications to these individual item overviews, with one exception. If a specific load status condition is met at the time the list is loaded (not when the overview is opened), the ability to make modifications should be disabled.
I have created a CSS class for the div that contains the overview content. I am looking for a way to dynamically add or remove properties from this class during page load, before any item detail is accessed. This way, depending on the load status, pointer events can be enabled or disabled for all subsequent item details that are viewed by the user.
Is it possible to achieve something like this using code such as:
my-css-class.addProperty("pointer-events: none");
Can CSS classes be updated on the fly in this manner? For additional context, I am working with TypeScript and Less CSS.