这里有很多关于这个的答案,我试图修改它们以适应但它不起作用。
我为它做了一个 jsfiddle:http: //jsfiddle.net/DrPz4/
选择箱码:
<div class="options">
<h2>Available Options</h2>
<br />
<div id="option-230" class="option">
<span class="required">*</span>
<b>Size:</b><br />
<select name="option[230]">
<option value=""> --- Please Select --- </option>
<option value="28">Size 10 </option>
<option value="29">Size 12 </option>
<option value="30">Size 14 </option>
<option value="32">Size 16 </option>
<option value="31">Size 18 </option>
<option value="117">Made to Measure </option>
</select>
</div>
<br />
<div id="option-253" class="option">
<b>Bust (cm):</b><br />
<input type="text" name="option[253]" value="" class="input-text" />
</div>
<br />
<div id="option-254" class="option">
<b>Waist (cm):</b><br />
<input type="text" name="option[254]" value="" class="input-text" />
</div>
<br />
<div id="option-255" class="option">
<b>Hips (cm):</b><br />
<input type="text" name="option[255]" value="" class="input-text" />
</div>
<br />
</div>
JS:
var MTM = jQuery('#option[230]');
var select = this.value;
MTM.change(function () {
if ($(this).val() == '117') {
$('#option-253').show();
}
else $('#option-253').hide();
});
谢谢