<select class="required-entry" id="customer" name="customer">
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
<option value="new">Add New Customer</option>
</select>
的Javascript:
<script type="text/javascript">
$('customer').observe("change",function(event){
var sourceElement = Event.findElement(event);
HideShow(sourceElement);
});
function HideShow(sourceElement)
{
console.log('come in this function');
}
</script>
我收到上述错误而改变的选项。
请帮我..我已经检查了许多参考,但没有帮助。
什么库/功能到底是'$ .observe' ...? – deceze
起初,你有错误的选择器,以选择#客户 $('客户'),而不是$('#客户') –
这真的是你的代码看起来,还是有嵌套函数定义在其他函数? – Barmar