In Javascript how can I set rgba without specifying the rgb?

前端 未结 5 1142
旧巷少年郎
旧巷少年郎 2020-12-17 08:09

I have an HTML element whose background colour is set with rgba()

T

5条回答
  •  天涯浪人
    2020-12-17 08:51

    You could also use elem.style.opacity=0.5 or in html style="opacity:0.5". It is important to note that the child nodes will fade too.

提交回复
热议问题