console
function radio_change(){
var radio1 = document.getElementById('radio1');
var radio2 = document.getElementById('radio2');
var text = document.getElementById('text');
if(radio1.checked){
text.disabled = '';
}else{
text.value = "";
text.disabled = "disabled";
}
}
<input type="radio" id="radio1" name="radio" onchange="radio_change()">可用
<input type="radio" id="radio2" name="radio" onchange="radio_change()">不可用
<input type="text" id="text" disabled>
input[type="text"]:enabled{
background: gold
}
input[type="text"]:disabled{
background: dimgray
}