Saturday, 24 June 2017

javascript - jQuery remove multiple styles

I want to set all my css to null with the use of jQuery.
I know you can do it like



$("[class^=col-]").css('width', '');
$("[class^=col-]").css('right', '');
$("[class^=col-]").css('margin', '');

$("[class^=col-]").css('position', '');


but is it possible to do it in one command, like:



$("[class^=col-]").css('');


Edit: i have looked in the post above and saw the answer.




By removing the style atrribute it works perfectly $("[class^=col-]").removeAttr("style")

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...