jquery remove css property

jquery remove css property : 2 different approaches to remove style inline CSS in jQuery. Use removeAttr() to remove all inline style attribute and Use CSS() to remove the specific CSS property.

jquery remove css property

jQuery remove style attribute, CSS inline with example. Using javascript to remove style attribute. demos of jQuery to Add, change, remove CSS for div, menu, table and more.

Read Also:  how to get client mac address in javascript?

Using jQuery .removeAttr()

.removeAttr() to remove all inline style.

<div id="new_member_info" style="color:blue;height:100px;width:200px;background-color:#e2e2e2;">
	<p>Welcome To Pakainfo</p>
</div>
<button id="first_btn">Delete All Inline Style</button>
<button id="new_cart">Delete Inline Style width</button>

$("#first_btn").on('click', function() {
 $("#new_member_info").removeAttr("style");
});

# Using jQuery .css() method

.css() method to remove specific CSS property.

$("#new_cart").on('click', function() {
  $("#new_member_info").css("width", "");
});

jQuery remove style added with .css() function

Example : 1

function remove_style() {
$("#tamil_upcomming_movies").css("border", "0");
}

Example : 2

$.css("background-color", "");

Example : 3

removeAttr( 'style' );

Example : 4

var allbodyDesign = document.body.style;
if (allbodyDesign.removeAttribute)
    allbodyDesign.removeAttribute('background-color');
else        
    allbodyDesign.removeProperty('background-color');

Example : 5

$("#cartdnew").removeAttr("style");
$("#cartdnew").removeAttr("background-color") 

Example : 6

  $("body").removeAttr("style");

Don’t Miss : How to add class dynamically in jQuery?

I hope you get an idea about jquery remove css property.
I would like to have feedback on my infinityknow.com.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.