How can I define value of a Variable in a style tag and then use that in ID attribute?

Hey everyone
I am new to this forum. I am trying to learn how bubble plugins are being developed. I am not from a coding background thus struggling with a simple logic.
Can I define a variable’s value inside a Style tag( that I have placed in header)?
I would like the user to just add that variable name in ID attribute of an element and this variable’s name should be be replaced by its value on run time.
Is this possible?
Thanks for your help in advance.