<script type="text/javascript">
function dis(elem, t){
if(elem.getAttribute('disabled') == 'disabled' || elem.disabled == true){
elem.disabled=false;
t.value = "disabled";
}else{
elem.setAttribute('disabled','disabled');
t.value = "enabled";
}
}
</script>
<input type="text" disabled="disabled" id="elem" />
<input type="button" onclick="dis(document.getElementById('elem'), this)" value="enabled" />