Someone Someone - 1 month ago 11
jQuery Question

apply font-weight bold to the option in the select Element

<style type = "text/css">
.myClass{
font-weight: bold ;
font-size: 8pt;
color:red;
}
</style>
$(document).ready(function(){
$("#select1 > option[data-status=YES]").addClass("myClass");
});


It is not working in IE 6.0 and IE 8.0 and It is working fine in Mozilla. How do I apply
font-weight: bold
to the
option
in the
select
element that has the
data-status
as "
YES
".

Answer

This is not possible in IE6. Styling form elements is extremely limited even in modern browsers.

You would have to use a JavaScript-based select alternative like this one.

Comments