HTML:
<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>
我在更改选项时遇到错误。
请帮帮我..我已经查了很多参考资料,但没有帮助。
答案 0 :(得分:-2)
尝试定义如下函数:
HideShow = function(sourceElement)
{
console.log('come in this function');
}