![](/img/trans.png)
[英]How do you change the background color of an <input> element with javascript
[英]how do you change color of nested css element in javascript?
<a id='123' href='www.stackoverflow.com'>
Hello <span style='color:#c0c0c0;text-decoration: underline;'>World</span>
</a>
我目前正在通过更改链接颜色
var chosenclass = document.getElementById('123');
chosenclass.style.color = '#000000';
但是现在我想通过仅引用selectedClass对象来更改跨度。 我怎样才能做到这一点 ?
chosenclass.children[0].style.color = '#000';
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.