im trying to trigger('blur'); on a collection of inputs but i does not seem to get this right.
example is avaible here http://jsfiddle.net/VUUme/1/
im getting the collection and i got the blur method done but im not sure about the trigger part tho.
var $inputs = $('#form').find('input');
alert('load');
$inputs.each(function(){
$(this).trigger('blur');
});
//i tried this to but with no success
//$inputs.trigger('blur');
alert('after the blur');
$inputs.blur(function(){
var $this = $(this);
if ($this.val() == ''){
alert('it works');
}
});
Put
trigger()after you define$inputs.blur():Updated fiddle: http://jsfiddle.net/VUUme/3/