Search code examples
jquerycssdisabled-input

Button label disappers after disable action


This is a very weird problem am facing

HTML:

<input type="button" id="buttonobj" class="some class" value ="Button Name"/>

jQuery:

$(function(){

 $buttonObject = $('#buttonObj");
 $buttonObject.button('disable');

});

When I run this code and watch the HTML in firebug, am getting

<input type="button" id=buttonobj" class="some class" value =""/>

The value vanishes.

What does the disable do here. how can it change the value. Is it possible for a css to change a button value??

Am Using jQuery-ui


Solution

  • Finally found out the problem!

    No one answered the question

    What does the disable do here. how can it change the value. Is it possible for a css to change a button value??

    The answer, it was a custom made jQuery Ui. On calling button.disable function, it is implicitly setting these two classes

    ui-button-disabled ui-state-disabled

    Thanks for all solution here, but I know all those ways of doing. Since it was a code which I was taking over from some one , I was not supposed to change but just find , Why it was not working while it was being integrated