我想自动将粗体属性转换为font-weight所示的font-weight:700而不是font-weight:bold;使用jquery [英] I want to convert automatically bold property to font-weight in integer like font-weight:700 instead of font-weight:bold; using jquery

查看:198
本文介绍了我想自动将粗体属性转换为font-weight所示的font-weight:700而不是font-weight:bold;使用jquery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将自动粗体属性转换为font-weight的font-weight,如font-weight:700而不是font-weight:bold;

例如



如果我得到具有font-weight属性的页面元素:粗体

i我在这里问我如何将其更改为font-wieght:bold to font-weight:700 using jquery。

I want to convert automatically bold property to font-weight in integer like font-weight:700 instead of font-weight:bold;
For example

if i get the element of page having property of font-weight:bold
i am asking here that how i change it to font-wieght:bold to font-weight:700 using jquery.

推荐答案

以下是我的建议:永远不要使用任何与样式相关的HTML属性,除了 class 。相反,总是使用CSS。然后,您可以使用jQuery轻松地向/从任何HTML元素集添加/删除/切换类:

http ://api.jquery.com/addClass/ [ ^ ],

http://api.jquery.com/removeClass/ [ ^ ],

http://api.jquery.com/toggleClass/ [ ^ ]。



参见:http://api.jquery.com/category/css [ ^ ]。



-SA
Here is what I will recommend: never use any style-related HTML attributes, except class. Instead, always use CSS. Then you can easily add/remove/toggle classes to/from any set of HTML elements dynamically using jQuery:
http://api.jquery.com/addClass/[^],
http://api.jquery.com/removeClass/[^],
http://api.jquery.com/toggleClass/[^].

See also: http://api.jquery.com/category/css[^].

—SA


这篇关于我想自动将粗体属性转换为font-weight所示的font-weight:700而不是font-weight:bold;使用jquery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆