Suhas
Suhas

Reputation: 61

How to make matched text bold with jquery chosen?

I am wondering how to make the matched part of the autocomplete suggestions bold when using jquery chosen plugin?

Anyone knows how to do that?

http://harvesthq.github.com/chosen/

Upvotes: 0

Views: 1383

Answers (3)

Youssef
Youssef

Reputation: 3114

Or this following CSS property as the name has changed

.chosen-container .chosen-results li em {
  font-style: normal;
  font-weight: bold;
}

Upvotes: 0

Stuart Burrows
Stuart Burrows

Reputation: 10814

On their example page this is the css selector they use:

.chzn-container .chzn-results li em {
  font-weight: bold;
}

The matched text is wrapped in an <em /> so you might need to set `font-style: normal;' as well.

Upvotes: 1

user1432124
user1432124

Reputation:

Yes Just in your php page search the result with the passed string and then change it using bold tag.Like

$result='Tom Cruise';//retreived frmo database
$passed_string='Tom';//passed string from which db is searched
then
$result=str_replace($passed_string,'<b>'.$passed_string.'</b>',$result);

Upvotes: 0

Related Questions