HTML
<div id="myDiv" style="width:100px;height:100px;transform:translate3d(0,0,0);"> //Some Content </div>
Using jQuery, how to remove the specific inline style i.e transform?
Approach: The jQuery attr() and removeAttr() methods are used to remove the inline style property. The attr() method sets the attribute value to empty (”).
To remove inline Styles from an existing page, open your page with the editor, select the paragraph (or the entire content by pressing CTRL + A) and then click on Remove Formatting button. Inline styles, while they have a purpose, are not the best way to maintain your Web site.
Using ! Adding the ! important keyword to any CSS rule lets the rule forcefully precede over all the other CSS rules for that element. It even overrides the inline styles from the markup.
You can remove CSS style properties from an element by setting the property to a null value, e.g. box. style. backgroundColor = null; . When an element's CSS property is set to null , the property is removed from the element.
You can use css
to remove the inline style:
Setting the value of a style property to an empty string removes that property from an element.
$("#myDiv").css("transform","");
DEMO
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With