bcm
bcm

Reputation: 5500

jquery get css property font-weight returning number instead of 'bold' in IE

I'm trying to get the font-weight of a property using latest jquery, doesn't work in IE somehow... on IE dev toolbar console -

$('#ctl00_ContentPlaceHolder1').css('font-weight')

returns

700 !

I checked in the source... can't see any problems with the style formatting. Works in FF.

Upvotes: 2

Views: 4200

Answers (2)

bcm
bcm

Reputation: 5500

ye, just realised that.. think jQuery should return the same value tho across browsers... I'm using this now

...
fontWeight = $(this).css('font-weight');
if (fontWeight == 'bold' || fontWeight == '700') {
...

Upvotes: 0

Jason Lewis
Jason Lewis

Reputation: 18665

Nothing out of the ordinary there, as bold is synonymous with 700.

http://www.w3.org/TR/CSS2/fonts.html#font-boldness

The font labeled "Bold" will often correspond to the weight value '700'.

Upvotes: 4

Related Questions