Is there a way to retrieve the CSS for the :active
state using jQuery? I am looking to create dynamic code so that I don't need to manually adjust the jQuery every time I want to style an element.
Edit
To clarify, I am trying to avoid using .addClass()
or .removeClass()
because the classes may vary for each element affected by my jQuery code.
Edit 2
Allow me to explain further what I am attempting to achieve.
I am working on developing a plugin for personal use, and instead of constantly modifying the code whenever I have a new element to apply the plugin to, I would like it to automatically retrieve the relevant CSS. My goal is to create a button with an :active
state, so that when the user clicks the button, it will remain in that state (by extracting the CSS from that state within the .css()
command). I prefer not to use .addClass()
or .removeClass()
since the :active
state will be unique for each button.