JoaMika
JoaMika

Reputation: 1827

Jquery Select Change Event - Lose Focus

I am creating floating labels for my select elements when a user selects an option.

<div class="jvFloat"><label class="placeHolder active" for="input_18_61">Salutation</label><select name="input_61" class="gfield_select newsel" tabindex="49" aria-required="true" aria-invalid="false"><option value="" selected="selected" class="gf_placeholder">Salutation</option><option value="Miss">Miss</option><option value="Ms.">Ms.</option><option value="Mrs.">Mrs.</option></select>

However the floating label, only appears when the user selects another input or loses focus of the select element.

How could I use the Jquery select change event, to de-focus the select element, after the user makes a choice?

$('select').change(function(){

})
.change();

Upvotes: 0

Views: 845

Answers (1)

Stefan Pakic
Stefan Pakic

Reputation: 66

This should work..

$('select').change(function(){

    $(this).trigger('blur');

})

Upvotes: 1

Related Questions