jQuery show()和hide()不起作用

jQuery show()和hide()不起作用,jquery,toggle,Jquery,Toggle,在此情况下,当用户在“尺寸”选择框中选择“自定义尺寸”时,预期的行为是显示自定义尺寸输入框,如胸围英寸和臀围英寸。我现在得到的是: <select name="options[203]" id="select_203" class=" required-entry product-custom-option" title="" onchange="opConfig.reloadPrice();if(this.options[this.selectedIndex].text=='Cust

在此情况下,当用户在“尺寸”选择框中选择“自定义尺寸”时,预期的行为是显示自定义尺寸输入框,如胸围英寸和臀围英寸。我现在得到的是:

<select name="options[203]" id="select_203"
 class=" required-entry product-custom-option"
 title="" onchange="opConfig.reloadPrice();if(this.options[this.selectedIndex].text=='Custom Size'){$('.custom_size').show();}else{$('.custom_size').hide();}">
所有可以以这种方式切换的元素都有“custom_size”类,在stylesheet styles.css中是“display:none”


但到目前为止,它似乎不起作用。知道为什么吗?非常感谢

刚刚想好了。正是noConflict将默认的$更改为$j。现在它开始工作了。

我看到您正在使用Prototype库和jQuery。你应该使用

if(this.options[this.selectedIndex].text=='Custom Size'){$('.custom_size').show();}else{$('.custom_size').hide();}