jQuery .change()事件没有被触发?

时间:2012-08-29 15:11:55

标签: javascript jquery forms onchange

示例位于http://jsfiddle.net/4RAPH/或见下文:

<select class="businessTypePullDown">
    <option value="" disabled selected>Business Type</option>
    <option value="1">General</option>
    <option value="2">Lawyer</option>
    <option value="3">Software Development</option>
    <option value="4">Auto-repair</option>
</select>

function filterPullDown () {
    alert('hello');
}

$("businessTypePullDown").change(filterPullDown);

1 个答案:

答案 0 :(得分:7)

只是一个错字,你错过了一个点:

 $(".businessTypePullDown")

您的小提琴已更新:http://jsfiddle.net/4RAPH/1/