javascript - Apply CSS to disabled button -
i want view disabled button as:
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:
which css attribute need use disabled buttons above (marked in red)?
jsfiddle:
try out prop()
$(document).ready(function () { $('#btnsearch').prop("disabled", true); $("#btnsearch").css({ 'background': "gray" }); });
@beargrylls check updated fiddle demo, working per requirement.
Comments
Post a Comment