jQuery更改CSS背景颜色 [英] Jquery Change CSS Background Color
本文介绍了jQuery更改CSS背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个ID为' center-layout '的元素-其中有一个<li>
,未分配ID或类.
I have an element with the id 'center-layout' - within this is an <li>
that has no id or class assigned.
它确实设置了背景色.我将如何使用jquery动态更改此li的背景颜色?
It does have background-color set. How would I dynamically change the background color of this li using jquery ?
谢谢
推荐答案
通过使用:
$('#center-layout li').css("background-color", "newcolor");
这篇关于jQuery更改CSS背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文