I am going to create a PHP snippet or can be considered as WordPress code snippet, and want to create a dynamic css class each time that module loaded on the front end, and that class will be used by jQuery to style my front end.
Here is the scenario:
Let suppose first time module loaded on front end, it should have a class like: module-front-end-123
and I can use this exact class from jQuery to style its content according to data living inside this module only.
And now suppose another module of same type added now it should generate some class like module-front-end-124
and I will be using this class from jQuery again to out put its styling as well.
Advantage of this approach will be this, I'll be writing my code snippet only once and when ever module gets loaded I'll be getting its own class and jQuery code will work on this module and for other module style will be working for other module independently.
I can create that class by PHP but don't know how to use that class in jQuery or any thing like that ...
Can anyone guide me please? I just want to write my style only once and each time that will applied to fetched class.