![](/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.