I have a form with multiple input fields. I’m using a blur function to trigger an AJAX request when ever an input field is clicked out of like so:
$(".innerItems input").blur(function() {
$.ajax({
// etc
});
});
However, I’ve also built a custom “select menu” using DIVs and jQuery like so:
http://jsfiddle.net/tctc91/gWS2L/
How can I simulate a “blur” so that when the value changes in my custom select menu, the AJAX request is triggered like it normally would if it were an input?
You can trigger events on elements programatically by using
trigger():So in your code, it would be: