开发者

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

开发者 https://www.devze.com 2023-01-04 21:33 出处:网络
I\'m trying to get the font-weight of a property using latest jquery, doe开发者_如何学Pythonsn\'t work in IE somehow... on IE dev toolbar console -

I'm trying to get the font-weight of a property using latest jquery, doe开发者_如何学Pythonsn'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.


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'.


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') {
...
0

精彩评论

暂无评论...
验证码 换一张
取 消