fn

resetStyle

v0.0.5

Restores the inline styles an element had before the most recent cached setStyle. With prop it restores a single property; otherwise it restores every property that was remembered. A no-op if nothing was cached.

Example

ts
resetStyle(el); // restore everything setStyle changed
resetStyle(el, 'transform'); // restore just the transform

Signature

ts
declare function resetStyle(element: Element | HTMLElement | null, prop?: string): void;

Parameters

ParameterTypeDescription
elementElement | HTMLElement | nullThe element to restore
prop?stringRestore only this property instead of all of them