js如何将li标签的内容设置为粗体

2024-10-14 12:58:22

1、新建一个html文件,命名为test.html,用于讲解js如何将li标签的内容设置为粗体。

js如何将li标签的内容设置为粗体

3、在test.html文件内,设置ul标签的id属性为aathree。

js如何将li标签的内容设置为粗体

5、在js标签内,通过id获得ul对象,将fontWeight属性设置为bolder,从而实现li标签内容的加粗。

js如何将li标签的内容设置为粗体
猜你喜欢