Reputation: 169
I need to prompt an alert message when a user selects a particular option in a select menu. Is there a way to do this using jQuery?
Upvotes: 2
Views: 1271
Reputation: 7854
assuming your select has an ID of myselect, and the value you want to check is "myval"
$("#myselect").change(function() {
if($(this).val() == "myval")
{
alert('message');
}
});
I havent tested this but the concept should be sound
Upvotes: 3
Reputation: 10502
I recently bumped into the jQuery Confirm Plugin. It may or may be what you are looking for.
Upvotes: 0