I want to enable/disable a button without jquery. Here\'s my code:
btn.setAttribute(\"disabled\", true);
Works. But this doesn\'t -- a butt
function getElement(elm){
return document.getElementById(elm);
}
/*-------------FUNCTION TO DISABLE AN TEXT BOX------------------*/
function disable(elm){
return getElement(elm).setAttribute("disabled", true);
}
//==============================================================//
/*--------------FUNCTION TO ENABLE AN TEXT BOX------------------*/
function enable(elm){
return getElement(elm).removeAttribute("disabled");
}
//==============================================================//
function disableEnable(){
if(getElement("button").disabled){
enable("button");
enable("input-button");
}
else{
disable("button");
disable("input-button");
}
}