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; }
Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s