<p> 1.你为什么喜欢上网?
<input type= "checkbox" name= "Q3" value= "1"> Contact information </label>
<input type= "checkbox" name= "Q3" value= "2" onclick="aaa(this)"> Other </label>
<br>
Please specify:<input type= "text" id="text1" name= "Q3Other" style= "width:300px;display:none"> <br>
<script language="JavaScript">
function aaa(obj){
if(obj.checked==true)document.getElementById("text1").style.display=""; else document.getElementById("text1").style.display="none"; }
</script>
<input type= "checkbox" name= "Q3" value= "1"> Contact information </label>
<input type= "checkbox" name= "Q3" value= "2" onclick="this.checked==true?text1.style.display='':text1.style.display='none';"> Other </label>
<br>
Please specify:<input type= "text" id="text1" name= "Q3Other" style= "width:300px;display:none"> <br>
http://msdn2.microsoft.com/en-us/library/ms530751.aspx
<label><input type= checkbox name= Q3 value="1">Contact information</label>
<label><input type= checkbox name= Q3 value="2" onClick="document.getElementById('Q3Other').parentNode.style.display=this.checked?'block':'none'">Other</label>
<div style="display:none;">Please specify: <input type="text" name="Q3Other" style="width:300px"></div>
</p>
<label><input type= checkbox name= Q3 value="1">Contact information</label>
<label><input type= checkbox name= Q3 value="2" onClick="document.getElementById('Q3Div').style.display=this.checked?'block':'none'">Other</label>
<div id="Q3Div" style="display:none;">Please specify: <input type="text" name="Q3Other" style="width:300px"></div>
</p>