A placeholder text for chosen.js selects

As soon as you click a chosen select the search input is selected and you cannot add a placeholder anymore, or can you ? 🙂

var $input = $('.chzn-search input');
$placeholder = $('
Type something...
'); $input.after($placeholder); $input.keyup(function(){ $placeholder.toggle($(this).val() === ''); }); .chzn-search .placeholder{ margin-top: -25px; margin-bottom: 15px; margin-left: 7px; color: $gray; }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s