Why won't my jQuery onChange event trigger?

I am having trouble with simple jquery. Here is my html.

 <label>Select User</label>
    <span class="field">
        <select name="selectUser" id="selectUser">
            <option value="">Choose One</option>
            @foreach (var item in Model.Users)
                <option value="@item.Id">@item.UserName</option>

Here is the script:

$('#selectUser').change( function() {    

now when i change the options in the select element nothing happens?


SelecUser was a typo, I fixed it and still No alert message.


Because your id is selecUser instead of selectUser

Try this

$('#selecUser').change(function() {    

you can try this as well

$('#selecUser').on("change",function() {    

first of all You need to change the id for selector. also you either need to write that code in documnet ready or use jquery on.Use:

$(document).on('change','#selecUser',function() {    

Your actual id is id="selecUser". Change it to selectUser

Need Your Help

what's the difference between folders 'installedApps' and 'applications' in websphere application server?


Normally, after we create profiles both DMGR and Node, we have folder applications under path $DMGRPROFILE_HOME/config/cells/$cellName and installedApps under path $NODEPROFILE_HOME/.

XCode: "To download this update...". Is this dialog normal?


I'm getting a dialog box asking to enter my apple developer id &amp; password in xcode. It just says something like "To download this update enter your information." then i goes away.