javascript - Apply CSS to disabled button -


i want view disabled button as:

enter image description here

the 1 marked red disabled button , green 1 enabled.

i trying apply css same follows:

 $(document).ready(function () {      $('#btnsearch').attr("disabled", true);      $("#btnsearch").css({ 'background': "#grey" });  }); 

but not showing mentioned in image.

its looking me this:

enter image description here

which css attribute need use disabled buttons above (marked in red)?

jsfiddle:

http://jsfiddle.net/54qjx/

try out prop()

 $(document).ready(function () {         $('#btnsearch').prop("disabled", true);         $("#btnsearch").css({ 'background': "gray" });  }); 

@beargrylls check updated fiddle demo, working per requirement.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -