Is it possible to conditionally add a class to an element based on its display property (eg. display: block
, display: none
) in JavaScript?
I'm guessing it would look something like this:
.addClass($invoiceTable.display=block ? "firstClass" : "secondClass");
where firstClass is added if invoiceTable has style="display: block", else the secondClass is added.