jquery not changing the DOM

jquery not changing the DOM

HI all
I am a bit stuck here:

What I am doing is that , I am based on a element being checked - I am disabling the input ( text box - minEntriesToDisplayResult ) and setting the value from 1 to null.

here is the code.

var isChecked = $('#'+elementId).attr('checked')?1:0;
         
         // If checked then disbale the attributes.
         if(isChecked){
            
            // disable and set value to null ( default is 1 )
            $('#minEntriesToDisplayResult').attr("value","").attr("disabled", "disabled");
}



everything looks fine from the frontend - the value becomes null and the textbox gets greyed ( disabled )
but when I look through the firebug ( or view source ) the value of the input box is still say 1 and not null which is what I set this to when i did the .attr('value','')

not sure whats wrong.

so again - the values in the textbox look fine in the UI but on view source
, the value has not changed from what it initially was.

so looks like the DOM has not changes.

any thoughts !

Thanks.