user957178
user957178

Reputation: 631

How to make the text bold using jquery

I have this out put.

<option value="18277">Dollar Max Hospice~Mx</option>
<option value="12979">Routine Adult Physical Exam Visit Limit</option>
<option value="12841">Is Reverse Sterilization Covered Out of Network?</option>
<option value="12918">MD CDH PPO Variables 2</option>
<option value="12917">DC CDH PPO Variables 2</option>
<option value="12833">Is Sterilization Covered No Network?</option>
<option value="12834">Is Sterilization Covered In Network</option>

I have a search box and button when i hit Dollar I need to bold the text in my list box. I need to itterate the list box data and make that text as bold.

Upvotes: 14

Views: 80531

Answers (3)

Freesn&#246;w
Freesn&#246;w

Reputation: 32133

Using the jQuery, you can apply the css:

font-weight:Bold;

So just do:

$myElement.css("font-weight","Bold");

Upvotes: 52

Niet the Dark Absol
Niet the Dark Absol

Reputation: 324600

You can't bold an individual <option> in a <select> control. It's annoying, but that's how it is.

Upvotes: 1

Bojangles
Bojangles

Reputation: 101473

For me on FF6 at least, it will show as a normal font in the select box, however in the actual list itself it will show bold if you do:

$('select option[value="18277"]').css({ 'font-weight': 'bold' });

Upvotes: 5

Related Questions