This code will add a class named
custom-class, to the ul li tag ( Unordered List ) conditionally.
Here’s the default HTML before the custom class is added :
And here’s the HTML output once the code in this solution is installed :
You can use this code to add a custom class to any existing class conditionally.
Register or login to access the download folder :