I have a Layout page
called Layout.cshtml
On that page I have a div
whose ID is friendsList
I have a View
called Users.cshtml
On that page I have a select tag
whose ID is AllowedFriends
and its value comes from the database
Now, I need to add
that AllowedFriends
to friendsList
, so I write the JQuery as below
$("#friendsList").append($("#AllowedFriends"));
Upto here it is fine.
Now I want to show an alert or do something when user changes the selection
on AllowedFriends
.
So I write the JQuery as below :
$("#AllowedFriends").change(function () {
// do something
});
But this does not work. I have tried to debug it. I used break point but this event never executes.