0

The defaults appearances for a <button> in different browser are different.

So i want to put with .animation() [so .toogleClass() does not provide a solution] a color on the button, and after that to go back to the default appearance of the button.

In order to do that, i want to do

var saveOriginalButtonCSS = $("#idbutton").css();
$("#idbutton").css("background-color","#4CAF50");
      
$("#idbutton").animate({
  'background-color': gray
  }, {
    duration : 5000,
    complete : function(){
      $("#idbutton").css(saveOriginalButtonCSS);
  }
});

but css() need a parameter. So how can i do ? thank's

Asons
  • 84,923
  • 12
  • 110
  • 165
Naeco
  • 133
  • 1
  • 1
  • 9
  • May I recommend to have a look here: https://necolas.github.io/normalize.css/ – Asons Mar 15 '18 at 12:20
  • buttons have no default css styling. If the browser renders their appearance differently it must be something other than css. https://www.w3schools.com/cssref/css_default_values.asp – Cybernetic Mar 15 '18 at 13:16

0 Answers0