当选择面议的时候,手一个选项不可用,当选择后面那个,输入框可以输入工资的多少,
请问用JS应该怎样写呢~!
麻烦各位教教
我已经写了一点点
<input type="radio" name="radiobutton" value="2" onclick="this.disabled=(this.disabled)"/> 
  面议
  <input   type=radio  name="radiobutton" value="1" onclick="this.disabled=!(this.disabled)"><input   type=text value=请输入工资 disabled="disabled" onfocus="this.value='';"  >  

解决方案 »

  1.   

    <input type="radio" name="radiobutton" value="2" onclick="document.getElementById('txt').disabled=this.checked;"/> 
      面议
      <input   type=radio  name="radiobutton" value="1" onclick="document.getElementById('txt').disabled=!this.checked;"><input type=text value=请输入工资 disabled="disabled" id='txt' onfocus="this.value='';"  >
      

  2.   

    L@_@K<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title> new document </title>
        <meta name="generator" content="editplus" />
        <meta name="author" content="Gao YiXiang" />
        <meta name="email" content="[email protected]" />
        <meta name="keywords" content="javascript dhtml dom" />
        <meta name="description" content="I love web development." />
    </head>
    <body>
        <input type="radio" name="radiobutton" value="2" onclick="tbxSalary.disabled=true;tbxSalary.value=tbxSalary.defaultValue"/>面议
        <input type="radio"  name="radiobutton" value="1" onclick="tbxSalary.disabled=false">
        <input type="text" value="请输入工资" id="tbxSalary" disabled="true" onfocus="this.value='';">
    </body>
    </html>