在simpleweather.js中将大写改为小写

Changing uppercase to lowercase in simpleweather.js

本文关键字:simpleweather js      更新时间:2023-09-26

我很挑剔,但是我想把当前天气状态的大写字母改为小写。多云到多云。另外,我该如何设置文本样式呢?我从来没有在jquery中使用过html。

html = '<span> It is currently ' + weather.currently + ' and </span>';

http://codepen.io/anon/pen/eNwzJp

http://simpleweatherjs.com/

就用

weather.currently.toLowerCase ()

对于样式,您可以将类添加到span标签

<span class="sample">

并在CSS中提供样式细节-

.sample {
  font-weight: bold;
}

有一个javascript方法toLowerCase()和toUpperCase()来解决你的问题。参考资料在这里

weather.currently.toLowerCase()

关于样式,您可以查看此站点