我有这个功能来显示或隐藏表格
function show_ticket_type(){
if ($("#TicketType").val("select-type")){
$("#tow_way").hide()
$("#one_way").hide()
}
else if ($("#TicketType").val("one-way")){
$("#tow_way").hide()
$("#one_way").show()
}
else{
$("#tow_way").show()
$("#one_way").hide()
}
}
桌子是
<table width="100%" border="0" id="tow_way">
<tr>
<th width="120"> <div align="center"><strong>Airlines</strong></div></th>
<th width="100"> <div align="center"><strong>Type</strong></div></th>
<th width="100"> <div align="center"><strong>From</strong></div></th>
<th width="100"> <div align="center"><strong>To</strong></div></th>
<th width="80"> <div align="center"><strong>Departure</strong></div></th>
<th width="100"> <div align="center"><strong>Returning</strong></div></th>
</tr>
</tbale>
<table width="100%" border="0" id="one_way">
<tr>
<th width="120"> <div align="center"><strong>Airlines</strong></div></th>
<th width="100"> <div align="center"><strong>Type</strong></div></th>
<th width="100"> <div align="center"><strong>From</strong></div></th>
<th width="100"> <div align="center"><strong>To</strong></div></th>
<th width="80"> <div align="center"><strong>Departure</strong></div></th>
</tr>
</tbale>
这是选择值时的选择类型,我们必须调用函数来隐藏或显示表格
<select id="TicketType" name="TicketType" onChange="show_ticket_type()">
<option value="select-type">-- Select --</option>
<option value="one-way">One Way</option>
<option value="tow-way">Return</option>
</select>
If I select One Way we must hide table tow_way and show table one_way and when select Tow way we must we must hide table one_way and show table tow_way else we must hide tow table
我的代码中的错误在哪里?