JavaScript – Clear Inline Style of Div

To clear Inline Style of a div using JavaScript, get reference to the div element, and assign empty string value to the element.style property.

Note: This solution clears only the inline style. Any global styles using style sheets shall be applied to the element.

Example

ADVERTISEMENT

Conclusion

In this JavaScript Tutorial, we learned how to clear inline style of a div using JavaScript.