Remove CSS properties from Inline styles using jQuery
In some context, we have to add few inline styles with JS. Later few scenarios will need only remove selected properties from that inline styles, not the entire style attribute.
In that case you can pass null value to your CSS key:value pair and all done. Example:
<script>
$(elm).css("margin", ""); //passing value as null.
</script>
Above value will remove the margin from inline style of elm in use.
Related protips:
jQuery: When to use $(document).ready() and when $(window).load()
Written by Shekhar Sharma
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Css
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#