After a bunch of animating, adding classes and setting css styles. is there an easy way to reset an element to be back in its original server delivered state?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
jQuery sets its manipulations using the inline
styleattribute, so just set that to''.This assumes there were no inline
styleattributes set on the element coming from the server. Better to use style sheets if so.If the element must come from the server with
styleattributes set, then I suppose you could cache the value in a variable, and reset it when needed.EDIT:
If needed, you could send your elements from the server with custom attributes to remember the original
classattribute, for example.Then you can reference the original anytime you need.
You could even find all elements that have the
originalClassattribute like this.or find elements where the
classattribute has been modified from the original.